muhammara 2.2.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/README.md +2 -2
  3. package/muhammara.d.ts +258 -241
  4. package/muhammara.js +1 -1
  5. package/node_modules/@mapbox/node-pre-gyp/CHANGELOG.md +4 -0
  6. package/node_modules/@mapbox/node-pre-gyp/lib/util/versioning.js +1 -1
  7. package/node_modules/@mapbox/node-pre-gyp/package.json +10 -10
  8. package/node_modules/concat-map/package.json +1 -1
  9. package/node_modules/console-control-strings/package.json +1 -1
  10. package/node_modules/debug/README.md +3 -0
  11. package/node_modules/debug/package.json +5 -5
  12. package/node_modules/debug/src/common.js +1 -1
  13. package/node_modules/delegates/package.json +1 -1
  14. package/node_modules/detect-libc/README.md +124 -42
  15. package/node_modules/detect-libc/index.d.ts +11 -0
  16. package/node_modules/detect-libc/lib/detect-libc.js +166 -80
  17. package/node_modules/detect-libc/lib/process.js +16 -0
  18. package/node_modules/detect-libc/package.json +20 -19
  19. package/node_modules/fs.realpath/package.json +1 -1
  20. package/node_modules/glob/common.js +2 -0
  21. package/node_modules/glob/glob.js +4 -1
  22. package/node_modules/glob/package.json +9 -6
  23. package/node_modules/glob/sync.js +6 -3
  24. package/node_modules/has-unicode/package.json +1 -1
  25. package/node_modules/https-proxy-agent/dist/agent.js +2 -5
  26. package/node_modules/https-proxy-agent/dist/agent.js.map +1 -1
  27. package/node_modules/https-proxy-agent/package.json +5 -5
  28. package/node_modules/inflight/package.json +1 -1
  29. package/node_modules/minimatch/package.json +5 -5
  30. package/node_modules/minipass/LICENSE +1 -1
  31. package/node_modules/minipass/README.md +122 -7
  32. package/node_modules/minipass/index.d.ts +149 -0
  33. package/node_modules/minipass/index.js +191 -102
  34. package/node_modules/minipass/package.json +23 -7
  35. package/node_modules/node-fetch/package.json +5 -5
  36. package/node_modules/object-assign/package.json +1 -1
  37. package/node_modules/once/package.json +1 -1
  38. package/node_modules/path-is-absolute/package.json +1 -1
  39. package/node_modules/semver/README.md +3 -1
  40. package/node_modules/semver/bin/semver.js +19 -9
  41. package/node_modules/semver/classes/comparator.js +3 -2
  42. package/node_modules/semver/classes/index.js +1 -1
  43. package/node_modules/semver/classes/range.js +31 -22
  44. package/node_modules/semver/classes/semver.js +1 -1
  45. package/node_modules/semver/functions/cmp.js +8 -4
  46. package/node_modules/semver/functions/coerce.js +3 -2
  47. package/node_modules/semver/functions/inc.js +4 -1
  48. package/node_modules/semver/functions/parse.js +1 -1
  49. package/node_modules/semver/internal/constants.js +2 -2
  50. package/node_modules/semver/internal/identifiers.js +1 -1
  51. package/node_modules/semver/internal/parse-options.js +3 -3
  52. package/node_modules/semver/internal/re.js +3 -3
  53. package/node_modules/semver/package.json +46 -13
  54. package/node_modules/semver/ranges/min-version.js +2 -1
  55. package/node_modules/semver/ranges/outside.js +1 -1
  56. package/node_modules/semver/ranges/simplify.js +15 -12
  57. package/node_modules/semver/ranges/subset.js +53 -31
  58. package/node_modules/set-blocking/package.json +1 -1
  59. package/node_modules/tr46/package.json +1 -1
  60. package/node_modules/util-deprecate/package.json +1 -1
  61. package/node_modules/webidl-conversions/package.json +1 -1
  62. package/node_modules/whatwg-url/package.json +1 -1
  63. package/node_modules/wrappy/package.json +1 -1
  64. package/package.json +2 -1
  65. package/src/DocumentCopyingContextDriver.cpp +15 -15
  66. package/src/ObjectsContextDriver.cpp +1 -1
  67. package/node_modules/detect-libc/.npmignore +0 -7
  68. package/node_modules/detect-libc/bin/detect-libc.js +0 -18
  69. package/node_modules/semver/CHANGELOG.md +0 -111
@@ -1,5 +1,5 @@
1
1
  module.exports = {
2
2
  SemVer: require('./semver.js'),
3
3
  Range: require('./range.js'),
4
- Comparator: require('./comparator.js')
4
+ Comparator: require('./comparator.js'),
5
5
  }
@@ -29,9 +29,9 @@ class Range {
29
29
  // First, split based on boolean or ||
30
30
  this.raw = range
31
31
  this.set = range
32
- .split(/\s*\|\|\s*/)
32
+ .split('||')
33
33
  // map the range to a 2d array of comparators
34
- .map(range => this.parseRange(range.trim()))
34
+ .map(r => this.parseRange(r.trim()))
35
35
  // throw out any comparator lists that are empty
36
36
  // this generally means that it was not a valid range, which is allowed
37
37
  // in loose mode, but will still throw if the WHOLE range is invalid.
@@ -46,9 +46,9 @@ class Range {
46
46
  // keep the first one, in case they're all null sets
47
47
  const first = this.set[0]
48
48
  this.set = this.set.filter(c => !isNullSet(c[0]))
49
- if (this.set.length === 0)
49
+ if (this.set.length === 0) {
50
50
  this.set = [first]
51
- else if (this.set.length > 1) {
51
+ } else if (this.set.length > 1) {
52
52
  // if we have any that are *, then the range is just *
53
53
  for (const c of this.set) {
54
54
  if (c.length === 1 && isAny(c[0])) {
@@ -84,8 +84,9 @@ class Range {
84
84
  const memoOpts = Object.keys(this.options).join(',')
85
85
  const memoKey = `parseRange:${memoOpts}:${range}`
86
86
  const cached = cache.get(memoKey)
87
- if (cached)
87
+ if (cached) {
88
88
  return cached
89
+ }
89
90
 
90
91
  const loose = this.options.loose
91
92
  // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
@@ -94,7 +95,7 @@ class Range {
94
95
  debug('hyphen replace', range)
95
96
  // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
96
97
  range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
97
- debug('comparator trim', range, re[t.COMPARATORTRIM])
98
+ debug('comparator trim', range)
98
99
 
99
100
  // `~ 1.2.3` => `~1.2.3`
100
101
  range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
@@ -108,30 +109,37 @@ class Range {
108
109
  // At this point, the range is completely trimmed and
109
110
  // ready to be split into comparators.
110
111
 
111
- const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
112
- const rangeList = range
112
+ let rangeList = range
113
113
  .split(' ')
114
114
  .map(comp => parseComparator(comp, this.options))
115
115
  .join(' ')
116
116
  .split(/\s+/)
117
117
  // >=0.0.0 is equivalent to *
118
118
  .map(comp => replaceGTE0(comp, this.options))
119
+
120
+ if (loose) {
119
121
  // in loose mode, throw out any that are not valid comparators
120
- .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true)
121
- .map(comp => new Comparator(comp, this.options))
122
+ rangeList = rangeList.filter(comp => {
123
+ debug('loose invalid filter', comp, this.options)
124
+ return !!comp.match(re[t.COMPARATORLOOSE])
125
+ })
126
+ }
127
+ debug('range list', rangeList)
122
128
 
123
129
  // if any comparators are the null set, then replace with JUST null set
124
130
  // if more than one comparator, remove any * comparators
125
131
  // also, don't include the same comparator more than once
126
- const l = rangeList.length
127
132
  const rangeMap = new Map()
128
- for (const comp of rangeList) {
129
- if (isNullSet(comp))
133
+ const comparators = rangeList.map(comp => new Comparator(comp, this.options))
134
+ for (const comp of comparators) {
135
+ if (isNullSet(comp)) {
130
136
  return [comp]
137
+ }
131
138
  rangeMap.set(comp.value, comp)
132
139
  }
133
- if (rangeMap.size > 1 && rangeMap.has(''))
140
+ if (rangeMap.size > 1 && rangeMap.has('')) {
134
141
  rangeMap.delete('')
142
+ }
135
143
 
136
144
  const result = [...rangeMap.values()]
137
145
  cache.set(memoKey, result)
@@ -196,7 +204,7 @@ const {
196
204
  t,
197
205
  comparatorTrimReplace,
198
206
  tildeTrimReplace,
199
- caretTrimReplace
207
+ caretTrimReplace,
200
208
  } = require('../internal/re')
201
209
 
202
210
  const isNullSet = c => c.value === '<0.0.0-0'
@@ -245,8 +253,8 @@ const isX = id => !id || id.toLowerCase() === 'x' || id === '*'
245
253
  // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
246
254
  // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
247
255
  const replaceTildes = (comp, options) =>
248
- comp.trim().split(/\s+/).map((comp) => {
249
- return replaceTilde(comp, options)
256
+ comp.trim().split(/\s+/).map((c) => {
257
+ return replaceTilde(c, options)
250
258
  }).join(' ')
251
259
 
252
260
  const replaceTilde = (comp, options) => {
@@ -284,8 +292,8 @@ const replaceTilde = (comp, options) => {
284
292
  // ^1.2.3 --> >=1.2.3 <2.0.0-0
285
293
  // ^1.2.0 --> >=1.2.0 <2.0.0-0
286
294
  const replaceCarets = (comp, options) =>
287
- comp.trim().split(/\s+/).map((comp) => {
288
- return replaceCaret(comp, options)
295
+ comp.trim().split(/\s+/).map((c) => {
296
+ return replaceCaret(c, options)
289
297
  }).join(' ')
290
298
 
291
299
  const replaceCaret = (comp, options) => {
@@ -343,8 +351,8 @@ const replaceCaret = (comp, options) => {
343
351
 
344
352
  const replaceXRanges = (comp, options) => {
345
353
  debug('replaceXRanges', comp, options)
346
- return comp.split(/\s+/).map((comp) => {
347
- return replaceXRange(comp, options)
354
+ return comp.split(/\s+/).map((c) => {
355
+ return replaceXRange(c, options)
348
356
  }).join(' ')
349
357
  }
350
358
 
@@ -405,8 +413,9 @@ const replaceXRange = (comp, options) => {
405
413
  }
406
414
  }
407
415
 
408
- if (gtlt === '<')
416
+ if (gtlt === '<') {
409
417
  pr = '-0'
418
+ }
410
419
 
411
420
  ret = `${gtlt + M}.${m}.${p}${pr}`
412
421
  } else if (xm) {
@@ -265,7 +265,7 @@ class SemVer {
265
265
  if (identifier) {
266
266
  // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
267
267
  // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
268
- if (this.prerelease[0] === identifier) {
268
+ if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
269
269
  if (isNaN(this.prerelease[1])) {
270
270
  this.prerelease = [identifier, 0]
271
271
  }
@@ -8,17 +8,21 @@ const lte = require('./lte')
8
8
  const cmp = (a, op, b, loose) => {
9
9
  switch (op) {
10
10
  case '===':
11
- if (typeof a === 'object')
11
+ if (typeof a === 'object') {
12
12
  a = a.version
13
- if (typeof b === 'object')
13
+ }
14
+ if (typeof b === 'object') {
14
15
  b = b.version
16
+ }
15
17
  return a === b
16
18
 
17
19
  case '!==':
18
- if (typeof a === 'object')
20
+ if (typeof a === 'object') {
19
21
  a = a.version
20
- if (typeof b === 'object')
22
+ }
23
+ if (typeof b === 'object') {
21
24
  b = b.version
25
+ }
22
26
  return a !== b
23
27
 
24
28
  case '':
@@ -1,6 +1,6 @@
1
1
  const SemVer = require('../classes/semver')
2
2
  const parse = require('./parse')
3
- const {re, t} = require('../internal/re')
3
+ const { re, t } = require('../internal/re')
4
4
 
5
5
  const coerce = (version, options) => {
6
6
  if (version instanceof SemVer) {
@@ -43,8 +43,9 @@ const coerce = (version, options) => {
43
43
  re[t.COERCERTL].lastIndex = -1
44
44
  }
45
45
 
46
- if (match === null)
46
+ if (match === null) {
47
47
  return null
48
+ }
48
49
 
49
50
  return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)
50
51
  }
@@ -7,7 +7,10 @@ const inc = (version, release, options, identifier) => {
7
7
  }
8
8
 
9
9
  try {
10
- return new SemVer(version, options).inc(release, identifier).version
10
+ return new SemVer(
11
+ version instanceof SemVer ? version.version : version,
12
+ options
13
+ ).inc(release, identifier).version
11
14
  } catch (er) {
12
15
  return null
13
16
  }
@@ -1,4 +1,4 @@
1
- const {MAX_LENGTH} = require('../internal/constants')
1
+ const { MAX_LENGTH } = require('../internal/constants')
2
2
  const { re, t } = require('../internal/re')
3
3
  const SemVer = require('../classes/semver')
4
4
 
@@ -4,7 +4,7 @@ const SEMVER_SPEC_VERSION = '2.0.0'
4
4
 
5
5
  const MAX_LENGTH = 256
6
6
  const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
7
- /* istanbul ignore next */ 9007199254740991
7
+ /* istanbul ignore next */ 9007199254740991
8
8
 
9
9
  // Max safe segment length for coercion.
10
10
  const MAX_SAFE_COMPONENT_LENGTH = 16
@@ -13,5 +13,5 @@ module.exports = {
13
13
  SEMVER_SPEC_VERSION,
14
14
  MAX_LENGTH,
15
15
  MAX_SAFE_INTEGER,
16
- MAX_SAFE_COMPONENT_LENGTH
16
+ MAX_SAFE_COMPONENT_LENGTH,
17
17
  }
@@ -19,5 +19,5 @@ const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)
19
19
 
20
20
  module.exports = {
21
21
  compareIdentifiers,
22
- rcompareIdentifiers
22
+ rcompareIdentifiers,
23
23
  }
@@ -4,8 +4,8 @@ const opts = ['includePrerelease', 'loose', 'rtl']
4
4
  const parseOptions = options =>
5
5
  !options ? {}
6
6
  : typeof options !== 'object' ? { loose: true }
7
- : opts.filter(k => options[k]).reduce((options, k) => {
8
- options[k] = true
9
- return options
7
+ : opts.filter(k => options[k]).reduce((o, k) => {
8
+ o[k] = true
9
+ return o
10
10
  }, {})
11
11
  module.exports = parseOptions
@@ -10,7 +10,7 @@ let R = 0
10
10
 
11
11
  const createToken = (name, value, isGlobal) => {
12
12
  const index = R++
13
- debug(index, value)
13
+ debug(name, index, value)
14
14
  t[name] = index
15
15
  src[index] = value
16
16
  re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
@@ -178,5 +178,5 @@ createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
178
178
  // Star ranges basically just allow anything at all.
179
179
  createToken('STAR', '(<|>)?=?\\s*\\*')
180
180
  // >=0.0.0 is like a star
181
- createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$')
182
- createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$')
181
+ createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$')
182
+ createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$')
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "semver@^7.3.5",
3
- "_id": "semver@7.3.5",
3
+ "_id": "semver@7.3.7",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
5
+ "_integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==",
6
6
  "_location": "/semver",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -18,10 +18,13 @@
18
18
  "_requiredBy": [
19
19
  "/@mapbox/node-pre-gyp"
20
20
  ],
21
- "_resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
22
- "_shasum": "0b621c879348d8998e4b0e4be94b3f12e6018ef7",
21
+ "_resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
22
+ "_shasum": "12c5b649afdbf9049707796e22a4028814ce523f",
23
23
  "_spec": "semver@^7.3.5",
24
24
  "_where": "/home/runner/work/MuhammaraJS/MuhammaraJS/node_modules/@mapbox/node-pre-gyp",
25
+ "author": {
26
+ "name": "GitHub Inc."
27
+ },
25
28
  "bin": {
26
29
  "semver": "bin/semver.js"
27
30
  },
@@ -35,20 +38,22 @@
35
38
  "deprecated": false,
36
39
  "description": "The semantic version parser used by npm.",
37
40
  "devDependencies": {
38
- "tap": "^14.10.7"
41
+ "@npmcli/eslint-config": "^3.0.1",
42
+ "@npmcli/template-oss": "3.3.2",
43
+ "tap": "^16.0.0"
39
44
  },
40
45
  "engines": {
41
46
  "node": ">=10"
42
47
  },
43
48
  "files": [
44
- "bin/**/*.js",
45
- "range.bnf",
46
- "classes/**/*.js",
47
- "functions/**/*.js",
48
- "internal/**/*.js",
49
- "ranges/**/*.js",
49
+ "bin/",
50
+ "classes/",
51
+ "functions/",
52
+ "internal/",
53
+ "ranges/",
50
54
  "index.js",
51
- "preload.js"
55
+ "preload.js",
56
+ "range.bnf"
52
57
  ],
53
58
  "homepage": "https://github.com/npm/node-semver#readme",
54
59
  "license": "ISC",
@@ -59,15 +64,43 @@
59
64
  "url": "git+https://github.com/npm/node-semver.git"
60
65
  },
61
66
  "scripts": {
67
+ "lint": "eslint \"**/*.js\"",
68
+ "lintfix": "npm run lint -- --fix",
69
+ "postlint": "template-oss-check",
62
70
  "postpublish": "git push origin --follow-tags",
71
+ "posttest": "npm run lint",
63
72
  "postversion": "npm publish",
73
+ "prepublishOnly": "git push origin --follow-tags",
64
74
  "preversion": "npm test",
65
75
  "snap": "tap",
76
+ "template-oss-apply": "template-oss-apply --force",
66
77
  "test": "tap"
67
78
  },
68
79
  "tap": {
69
80
  "check-coverage": true,
70
81
  "coverage-map": "map.js"
71
82
  },
72
- "version": "7.3.5"
83
+ "templateOSS": {
84
+ "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
85
+ "version": "3.3.2",
86
+ "engines": ">=10",
87
+ "ciVersions": [
88
+ "10.0.0",
89
+ "10.x",
90
+ "12.x",
91
+ "14.x",
92
+ "16.x"
93
+ ],
94
+ "distPaths": [
95
+ "bin/",
96
+ "classes/",
97
+ "functions/",
98
+ "internal/",
99
+ "ranges/",
100
+ "index.js",
101
+ "preload.js",
102
+ "range.bnf"
103
+ ]
104
+ },
105
+ "version": "7.3.7"
73
106
  }
@@ -47,8 +47,9 @@ const minVersion = (range, loose) => {
47
47
  throw new Error(`Unexpected operation: ${comparator.operator}`)
48
48
  }
49
49
  })
50
- if (setMin && (!minver || gt(minver, setMin)))
50
+ if (setMin && (!minver || gt(minver, setMin))) {
51
51
  minver = setMin
52
+ }
52
53
  }
53
54
 
54
55
  if (minver && range.test(minver)) {
@@ -1,6 +1,6 @@
1
1
  const SemVer = require('../classes/semver')
2
2
  const Comparator = require('../classes/comparator')
3
- const {ANY} = Comparator
3
+ const { ANY } = Comparator
4
4
  const Range = require('../classes/range')
5
5
  const satisfies = require('../functions/satisfies')
6
6
  const gt = require('../functions/gt')
@@ -5,38 +5,41 @@ const satisfies = require('../functions/satisfies.js')
5
5
  const compare = require('../functions/compare.js')
6
6
  module.exports = (versions, range, options) => {
7
7
  const set = []
8
- let min = null
8
+ let first = null
9
9
  let prev = null
10
10
  const v = versions.sort((a, b) => compare(a, b, options))
11
11
  for (const version of v) {
12
12
  const included = satisfies(version, range, options)
13
13
  if (included) {
14
14
  prev = version
15
- if (!min)
16
- min = version
15
+ if (!first) {
16
+ first = version
17
+ }
17
18
  } else {
18
19
  if (prev) {
19
- set.push([min, prev])
20
+ set.push([first, prev])
20
21
  }
21
22
  prev = null
22
- min = null
23
+ first = null
23
24
  }
24
25
  }
25
- if (min)
26
- set.push([min, null])
26
+ if (first) {
27
+ set.push([first, null])
28
+ }
27
29
 
28
30
  const ranges = []
29
31
  for (const [min, max] of set) {
30
- if (min === max)
32
+ if (min === max) {
31
33
  ranges.push(min)
32
- else if (!max && min === v[0])
34
+ } else if (!max && min === v[0]) {
33
35
  ranges.push('*')
34
- else if (!max)
36
+ } else if (!max) {
35
37
  ranges.push(`>=${min}`)
36
- else if (min === v[0])
38
+ } else if (min === v[0]) {
37
39
  ranges.push(`<=${max}`)
38
- else
40
+ } else {
39
41
  ranges.push(`${min} - ${max}`)
42
+ }
40
43
  }
41
44
  const simplified = ranges.join(' || ')
42
45
  const original = typeof range.raw === 'string' ? range.raw : String(range)
@@ -41,8 +41,9 @@ const compare = require('../functions/compare.js')
41
41
  // - Else return true
42
42
 
43
43
  const subset = (sub, dom, options = {}) => {
44
- if (sub === dom)
44
+ if (sub === dom) {
45
45
  return true
46
+ }
46
47
 
47
48
  sub = new Range(sub, options)
48
49
  dom = new Range(dom, options)
@@ -52,73 +53,84 @@ const subset = (sub, dom, options = {}) => {
52
53
  for (const simpleDom of dom.set) {
53
54
  const isSub = simpleSubset(simpleSub, simpleDom, options)
54
55
  sawNonNull = sawNonNull || isSub !== null
55
- if (isSub)
56
+ if (isSub) {
56
57
  continue OUTER
58
+ }
57
59
  }
58
60
  // the null set is a subset of everything, but null simple ranges in
59
61
  // a complex range should be ignored. so if we saw a non-null range,
60
62
  // then we know this isn't a subset, but if EVERY simple range was null,
61
63
  // then it is a subset.
62
- if (sawNonNull)
64
+ if (sawNonNull) {
63
65
  return false
66
+ }
64
67
  }
65
68
  return true
66
69
  }
67
70
 
68
71
  const simpleSubset = (sub, dom, options) => {
69
- if (sub === dom)
72
+ if (sub === dom) {
70
73
  return true
74
+ }
71
75
 
72
76
  if (sub.length === 1 && sub[0].semver === ANY) {
73
- if (dom.length === 1 && dom[0].semver === ANY)
77
+ if (dom.length === 1 && dom[0].semver === ANY) {
74
78
  return true
75
- else if (options.includePrerelease)
76
- sub = [ new Comparator('>=0.0.0-0') ]
77
- else
78
- sub = [ new Comparator('>=0.0.0') ]
79
+ } else if (options.includePrerelease) {
80
+ sub = [new Comparator('>=0.0.0-0')]
81
+ } else {
82
+ sub = [new Comparator('>=0.0.0')]
83
+ }
79
84
  }
80
85
 
81
86
  if (dom.length === 1 && dom[0].semver === ANY) {
82
- if (options.includePrerelease)
87
+ if (options.includePrerelease) {
83
88
  return true
84
- else
85
- dom = [ new Comparator('>=0.0.0') ]
89
+ } else {
90
+ dom = [new Comparator('>=0.0.0')]
91
+ }
86
92
  }
87
93
 
88
94
  const eqSet = new Set()
89
95
  let gt, lt
90
96
  for (const c of sub) {
91
- if (c.operator === '>' || c.operator === '>=')
97
+ if (c.operator === '>' || c.operator === '>=') {
92
98
  gt = higherGT(gt, c, options)
93
- else if (c.operator === '<' || c.operator === '<=')
99
+ } else if (c.operator === '<' || c.operator === '<=') {
94
100
  lt = lowerLT(lt, c, options)
95
- else
101
+ } else {
96
102
  eqSet.add(c.semver)
103
+ }
97
104
  }
98
105
 
99
- if (eqSet.size > 1)
106
+ if (eqSet.size > 1) {
100
107
  return null
108
+ }
101
109
 
102
110
  let gtltComp
103
111
  if (gt && lt) {
104
112
  gtltComp = compare(gt.semver, lt.semver, options)
105
- if (gtltComp > 0)
113
+ if (gtltComp > 0) {
106
114
  return null
107
- else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<='))
115
+ } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {
108
116
  return null
117
+ }
109
118
  }
110
119
 
111
120
  // will iterate one or zero times
112
121
  for (const eq of eqSet) {
113
- if (gt && !satisfies(eq, String(gt), options))
122
+ if (gt && !satisfies(eq, String(gt), options)) {
114
123
  return null
124
+ }
115
125
 
116
- if (lt && !satisfies(eq, String(lt), options))
126
+ if (lt && !satisfies(eq, String(lt), options)) {
117
127
  return null
128
+ }
118
129
 
119
130
  for (const c of dom) {
120
- if (!satisfies(eq, String(c), options))
131
+ if (!satisfies(eq, String(c), options)) {
121
132
  return false
133
+ }
122
134
  }
123
135
 
124
136
  return true
@@ -154,10 +166,12 @@ const simpleSubset = (sub, dom, options) => {
154
166
  }
155
167
  if (c.operator === '>' || c.operator === '>=') {
156
168
  higher = higherGT(gt, c, options)
157
- if (higher === c && higher !== gt)
169
+ if (higher === c && higher !== gt) {
158
170
  return false
159
- } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options))
171
+ }
172
+ } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {
160
173
  return false
174
+ }
161
175
  }
162
176
  if (lt) {
163
177
  if (needDomLTPre) {
@@ -170,37 +184,44 @@ const simpleSubset = (sub, dom, options) => {
170
184
  }
171
185
  if (c.operator === '<' || c.operator === '<=') {
172
186
  lower = lowerLT(lt, c, options)
173
- if (lower === c && lower !== lt)
187
+ if (lower === c && lower !== lt) {
174
188
  return false
175
- } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options))
189
+ }
190
+ } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {
176
191
  return false
192
+ }
177
193
  }
178
- if (!c.operator && (lt || gt) && gtltComp !== 0)
194
+ if (!c.operator && (lt || gt) && gtltComp !== 0) {
179
195
  return false
196
+ }
180
197
  }
181
198
 
182
199
  // if there was a < or >, and nothing in the dom, then must be false
183
200
  // UNLESS it was limited by another range in the other direction.
184
201
  // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
185
- if (gt && hasDomLT && !lt && gtltComp !== 0)
202
+ if (gt && hasDomLT && !lt && gtltComp !== 0) {
186
203
  return false
204
+ }
187
205
 
188
- if (lt && hasDomGT && !gt && gtltComp !== 0)
206
+ if (lt && hasDomGT && !gt && gtltComp !== 0) {
189
207
  return false
208
+ }
190
209
 
191
210
  // we needed a prerelease range in a specific tuple, but didn't get one
192
211
  // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,
193
212
  // because it includes prereleases in the 1.2.3 tuple
194
- if (needDomGTPre || needDomLTPre)
213
+ if (needDomGTPre || needDomLTPre) {
195
214
  return false
215
+ }
196
216
 
197
217
  return true
198
218
  }
199
219
 
200
220
  // >=1.2.3 is lower than >1.2.3
201
221
  const higherGT = (a, b, options) => {
202
- if (!a)
222
+ if (!a) {
203
223
  return b
224
+ }
204
225
  const comp = compare(a.semver, b.semver, options)
205
226
  return comp > 0 ? a
206
227
  : comp < 0 ? b
@@ -210,8 +231,9 @@ const higherGT = (a, b, options) => {
210
231
 
211
232
  // <=1.2.3 is higher than <1.2.3
212
233
  const lowerLT = (a, b, options) => {
213
- if (!a)
234
+ if (!a) {
214
235
  return b
236
+ }
215
237
  const comp = compare(a.semver, b.semver, options)
216
238
  return comp < 0 ? a
217
239
  : comp > 0 ? b
@@ -2,7 +2,7 @@
2
2
  "_from": "set-blocking@^2.0.0",
3
3
  "_id": "set-blocking@2.0.0",
4
4
  "_inBundle": false,
5
- "_integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
5
+ "_integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
6
6
  "_location": "/set-blocking",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -2,7 +2,7 @@
2
2
  "_from": "tr46@~0.0.3",
3
3
  "_id": "tr46@0.0.3",
4
4
  "_inBundle": false,
5
- "_integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=",
5
+ "_integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
6
6
  "_location": "/tr46",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {