node-datachannel 0.5.0-dev → 0.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 (333) hide show
  1. package/CMakeLists.txt +1 -1
  2. package/examples/electron-demo/package-lock.json +164 -419
  3. package/examples/electron-demo/package.json +2 -2
  4. package/lib/index.d.ts +5 -0
  5. package/lib/index.js +33 -2
  6. package/package.json +1 -5
  7. package/polyfill/RTCDtlsTransport.js +30 -12
  8. package/polyfill/RTCIceCandidate.js +1 -1
  9. package/polyfill/RTCIceTransport.js +48 -21
  10. package/polyfill/RTCPeerConnection.js +46 -23
  11. package/polyfill/RTCSctpTransport.js +33 -14
  12. package/src/peer-connection-wrapper.cpp +50 -0
  13. package/src/peer-connection-wrapper.h +2 -0
  14. package/test/connectivity.js +1 -1
  15. package/test/polyfill-connectivity.js +2 -1
  16. package/test/test.js +2 -2
  17. package/examples/build/Dockerfile +0 -30
  18. package/examples/build/README.md +0 -24
  19. package/node_modules/base64-js/LICENSE +0 -21
  20. package/node_modules/base64-js/README.md +0 -34
  21. package/node_modules/base64-js/base64js.min.js +0 -1
  22. package/node_modules/base64-js/index.d.ts +0 -3
  23. package/node_modules/base64-js/index.js +0 -150
  24. package/node_modules/base64-js/package.json +0 -47
  25. package/node_modules/buffer/AUTHORS.md +0 -70
  26. package/node_modules/buffer/LICENSE +0 -21
  27. package/node_modules/buffer/README.md +0 -410
  28. package/node_modules/buffer/index.d.ts +0 -186
  29. package/node_modules/buffer/index.js +0 -1817
  30. package/node_modules/buffer/package.json +0 -96
  31. package/node_modules/chownr/LICENSE +0 -15
  32. package/node_modules/chownr/README.md +0 -3
  33. package/node_modules/chownr/chownr.js +0 -167
  34. package/node_modules/chownr/package.json +0 -29
  35. package/node_modules/decompress-response/index.d.ts +0 -22
  36. package/node_modules/decompress-response/index.js +0 -58
  37. package/node_modules/decompress-response/license +0 -9
  38. package/node_modules/decompress-response/package.json +0 -56
  39. package/node_modules/decompress-response/readme.md +0 -48
  40. package/node_modules/deep-extend/CHANGELOG.md +0 -46
  41. package/node_modules/deep-extend/LICENSE +0 -20
  42. package/node_modules/deep-extend/README.md +0 -91
  43. package/node_modules/deep-extend/index.js +0 -1
  44. package/node_modules/deep-extend/lib/deep-extend.js +0 -150
  45. package/node_modules/deep-extend/package.json +0 -62
  46. package/node_modules/detect-libc/LICENSE +0 -201
  47. package/node_modules/detect-libc/README.md +0 -163
  48. package/node_modules/detect-libc/index.d.ts +0 -14
  49. package/node_modules/detect-libc/lib/detect-libc.js +0 -279
  50. package/node_modules/detect-libc/lib/filesystem.js +0 -41
  51. package/node_modules/detect-libc/lib/process.js +0 -19
  52. package/node_modules/detect-libc/package.json +0 -40
  53. package/node_modules/end-of-stream/LICENSE +0 -21
  54. package/node_modules/end-of-stream/README.md +0 -54
  55. package/node_modules/end-of-stream/index.js +0 -94
  56. package/node_modules/end-of-stream/package.json +0 -37
  57. package/node_modules/expand-template/.travis.yml +0 -6
  58. package/node_modules/expand-template/LICENSE +0 -21
  59. package/node_modules/expand-template/README.md +0 -43
  60. package/node_modules/expand-template/index.js +0 -26
  61. package/node_modules/expand-template/package.json +0 -29
  62. package/node_modules/expand-template/test.js +0 -67
  63. package/node_modules/fs-constants/LICENSE +0 -21
  64. package/node_modules/fs-constants/README.md +0 -26
  65. package/node_modules/fs-constants/browser.js +0 -1
  66. package/node_modules/fs-constants/index.js +0 -1
  67. package/node_modules/fs-constants/package.json +0 -19
  68. package/node_modules/github-from-package/.travis.yml +0 -4
  69. package/node_modules/github-from-package/LICENSE +0 -18
  70. package/node_modules/github-from-package/example/package.json +0 -8
  71. package/node_modules/github-from-package/example/url.js +0 -3
  72. package/node_modules/github-from-package/index.js +0 -17
  73. package/node_modules/github-from-package/package.json +0 -30
  74. package/node_modules/github-from-package/readme.markdown +0 -53
  75. package/node_modules/github-from-package/test/a.json +0 -8
  76. package/node_modules/github-from-package/test/b.json +0 -5
  77. package/node_modules/github-from-package/test/c.json +0 -5
  78. package/node_modules/github-from-package/test/d.json +0 -7
  79. package/node_modules/github-from-package/test/e.json +0 -5
  80. package/node_modules/github-from-package/test/url.js +0 -19
  81. package/node_modules/ieee754/LICENSE +0 -11
  82. package/node_modules/ieee754/README.md +0 -51
  83. package/node_modules/ieee754/index.d.ts +0 -10
  84. package/node_modules/ieee754/index.js +0 -85
  85. package/node_modules/ieee754/package.json +0 -52
  86. package/node_modules/inherits/LICENSE +0 -16
  87. package/node_modules/inherits/README.md +0 -42
  88. package/node_modules/inherits/inherits.js +0 -9
  89. package/node_modules/inherits/inherits_browser.js +0 -27
  90. package/node_modules/inherits/package.json +0 -29
  91. package/node_modules/ini/LICENSE +0 -15
  92. package/node_modules/ini/README.md +0 -102
  93. package/node_modules/ini/ini.js +0 -206
  94. package/node_modules/ini/package.json +0 -33
  95. package/node_modules/mimic-response/index.d.ts +0 -17
  96. package/node_modules/mimic-response/index.js +0 -77
  97. package/node_modules/mimic-response/license +0 -9
  98. package/node_modules/mimic-response/package.json +0 -42
  99. package/node_modules/mimic-response/readme.md +0 -78
  100. package/node_modules/minimist/.eslintrc +0 -29
  101. package/node_modules/minimist/.github/FUNDING.yml +0 -12
  102. package/node_modules/minimist/.nycrc +0 -14
  103. package/node_modules/minimist/CHANGELOG.md +0 -298
  104. package/node_modules/minimist/LICENSE +0 -18
  105. package/node_modules/minimist/README.md +0 -121
  106. package/node_modules/minimist/example/parse.js +0 -4
  107. package/node_modules/minimist/index.js +0 -263
  108. package/node_modules/minimist/package.json +0 -75
  109. package/node_modules/minimist/test/all_bool.js +0 -34
  110. package/node_modules/minimist/test/bool.js +0 -177
  111. package/node_modules/minimist/test/dash.js +0 -43
  112. package/node_modules/minimist/test/default_bool.js +0 -37
  113. package/node_modules/minimist/test/dotted.js +0 -24
  114. package/node_modules/minimist/test/kv_short.js +0 -32
  115. package/node_modules/minimist/test/long.js +0 -33
  116. package/node_modules/minimist/test/num.js +0 -38
  117. package/node_modules/minimist/test/parse.js +0 -209
  118. package/node_modules/minimist/test/parse_modified.js +0 -11
  119. package/node_modules/minimist/test/proto.js +0 -64
  120. package/node_modules/minimist/test/short.js +0 -69
  121. package/node_modules/minimist/test/stop_early.js +0 -17
  122. package/node_modules/minimist/test/unknown.js +0 -104
  123. package/node_modules/minimist/test/whitespace.js +0 -10
  124. package/node_modules/mkdirp-classic/LICENSE +0 -21
  125. package/node_modules/mkdirp-classic/README.md +0 -18
  126. package/node_modules/mkdirp-classic/index.js +0 -98
  127. package/node_modules/mkdirp-classic/package.json +0 -18
  128. package/node_modules/napi-build-utils/LICENSE +0 -21
  129. package/node_modules/napi-build-utils/README.md +0 -48
  130. package/node_modules/napi-build-utils/index.js +0 -213
  131. package/node_modules/napi-build-utils/index.md +0 -81
  132. package/node_modules/napi-build-utils/package.json +0 -41
  133. package/node_modules/node-abi/LICENSE +0 -21
  134. package/node_modules/node-abi/README.md +0 -52
  135. package/node_modules/node-abi/abi_registry.json +0 -276
  136. package/node_modules/node-abi/index.js +0 -179
  137. package/node_modules/node-abi/package.json +0 -41
  138. package/node_modules/once/LICENSE +0 -15
  139. package/node_modules/once/README.md +0 -79
  140. package/node_modules/once/once.js +0 -42
  141. package/node_modules/once/package.json +0 -33
  142. package/node_modules/prebuild-install/CHANGELOG.md +0 -116
  143. package/node_modules/prebuild-install/CONTRIBUTING.md +0 -6
  144. package/node_modules/prebuild-install/LICENSE +0 -21
  145. package/node_modules/prebuild-install/README.md +0 -163
  146. package/node_modules/prebuild-install/asset.js +0 -44
  147. package/node_modules/prebuild-install/bin.js +0 -78
  148. package/node_modules/prebuild-install/download.js +0 -142
  149. package/node_modules/prebuild-install/error.js +0 -14
  150. package/node_modules/prebuild-install/help.txt +0 -16
  151. package/node_modules/prebuild-install/index.js +0 -1
  152. package/node_modules/prebuild-install/log.js +0 -33
  153. package/node_modules/prebuild-install/package.json +0 -67
  154. package/node_modules/prebuild-install/proxy.js +0 -35
  155. package/node_modules/prebuild-install/rc.js +0 -64
  156. package/node_modules/prebuild-install/util.js +0 -143
  157. package/node_modules/pump/.travis.yml +0 -5
  158. package/node_modules/pump/LICENSE +0 -21
  159. package/node_modules/pump/README.md +0 -65
  160. package/node_modules/pump/index.js +0 -82
  161. package/node_modules/pump/package.json +0 -24
  162. package/node_modules/pump/test-browser.js +0 -66
  163. package/node_modules/pump/test-node.js +0 -53
  164. package/node_modules/rc/LICENSE.APACHE2 +0 -15
  165. package/node_modules/rc/LICENSE.BSD +0 -26
  166. package/node_modules/rc/LICENSE.MIT +0 -24
  167. package/node_modules/rc/README.md +0 -227
  168. package/node_modules/rc/browser.js +0 -7
  169. package/node_modules/rc/cli.js +0 -4
  170. package/node_modules/rc/index.js +0 -53
  171. package/node_modules/rc/lib/utils.js +0 -104
  172. package/node_modules/rc/node_modules/strip-json-comments/index.js +0 -70
  173. package/node_modules/rc/node_modules/strip-json-comments/license +0 -21
  174. package/node_modules/rc/node_modules/strip-json-comments/package.json +0 -42
  175. package/node_modules/rc/node_modules/strip-json-comments/readme.md +0 -64
  176. package/node_modules/rc/package.json +0 -29
  177. package/node_modules/rc/test/ini.js +0 -16
  178. package/node_modules/rc/test/nested-env-vars.js +0 -50
  179. package/node_modules/rc/test/test.js +0 -59
  180. package/node_modules/safe-buffer/LICENSE +0 -21
  181. package/node_modules/safe-buffer/README.md +0 -584
  182. package/node_modules/safe-buffer/index.d.ts +0 -187
  183. package/node_modules/safe-buffer/index.js +0 -65
  184. package/node_modules/safe-buffer/package.json +0 -51
  185. package/node_modules/semver/LICENSE +0 -15
  186. package/node_modules/semver/README.md +0 -637
  187. package/node_modules/semver/bin/semver.js +0 -197
  188. package/node_modules/semver/classes/comparator.js +0 -141
  189. package/node_modules/semver/classes/index.js +0 -5
  190. package/node_modules/semver/classes/range.js +0 -539
  191. package/node_modules/semver/classes/semver.js +0 -302
  192. package/node_modules/semver/functions/clean.js +0 -6
  193. package/node_modules/semver/functions/cmp.js +0 -52
  194. package/node_modules/semver/functions/coerce.js +0 -52
  195. package/node_modules/semver/functions/compare-build.js +0 -7
  196. package/node_modules/semver/functions/compare-loose.js +0 -3
  197. package/node_modules/semver/functions/compare.js +0 -5
  198. package/node_modules/semver/functions/diff.js +0 -65
  199. package/node_modules/semver/functions/eq.js +0 -3
  200. package/node_modules/semver/functions/gt.js +0 -3
  201. package/node_modules/semver/functions/gte.js +0 -3
  202. package/node_modules/semver/functions/inc.js +0 -19
  203. package/node_modules/semver/functions/lt.js +0 -3
  204. package/node_modules/semver/functions/lte.js +0 -3
  205. package/node_modules/semver/functions/major.js +0 -3
  206. package/node_modules/semver/functions/minor.js +0 -3
  207. package/node_modules/semver/functions/neq.js +0 -3
  208. package/node_modules/semver/functions/parse.js +0 -16
  209. package/node_modules/semver/functions/patch.js +0 -3
  210. package/node_modules/semver/functions/prerelease.js +0 -6
  211. package/node_modules/semver/functions/rcompare.js +0 -3
  212. package/node_modules/semver/functions/rsort.js +0 -3
  213. package/node_modules/semver/functions/satisfies.js +0 -10
  214. package/node_modules/semver/functions/sort.js +0 -3
  215. package/node_modules/semver/functions/valid.js +0 -6
  216. package/node_modules/semver/index.js +0 -89
  217. package/node_modules/semver/internal/constants.js +0 -35
  218. package/node_modules/semver/internal/debug.js +0 -9
  219. package/node_modules/semver/internal/identifiers.js +0 -23
  220. package/node_modules/semver/internal/parse-options.js +0 -15
  221. package/node_modules/semver/internal/re.js +0 -212
  222. package/node_modules/semver/node_modules/lru-cache/LICENSE +0 -15
  223. package/node_modules/semver/node_modules/lru-cache/README.md +0 -166
  224. package/node_modules/semver/node_modules/lru-cache/index.js +0 -334
  225. package/node_modules/semver/node_modules/lru-cache/package.json +0 -34
  226. package/node_modules/semver/node_modules/yallist/LICENSE +0 -15
  227. package/node_modules/semver/node_modules/yallist/README.md +0 -204
  228. package/node_modules/semver/node_modules/yallist/iterator.js +0 -8
  229. package/node_modules/semver/node_modules/yallist/package.json +0 -29
  230. package/node_modules/semver/node_modules/yallist/yallist.js +0 -426
  231. package/node_modules/semver/package.json +0 -87
  232. package/node_modules/semver/preload.js +0 -2
  233. package/node_modules/semver/range.bnf +0 -16
  234. package/node_modules/semver/ranges/gtr.js +0 -4
  235. package/node_modules/semver/ranges/intersects.js +0 -7
  236. package/node_modules/semver/ranges/ltr.js +0 -4
  237. package/node_modules/semver/ranges/max-satisfying.js +0 -25
  238. package/node_modules/semver/ranges/min-satisfying.js +0 -24
  239. package/node_modules/semver/ranges/min-version.js +0 -61
  240. package/node_modules/semver/ranges/outside.js +0 -80
  241. package/node_modules/semver/ranges/simplify.js +0 -47
  242. package/node_modules/semver/ranges/subset.js +0 -247
  243. package/node_modules/semver/ranges/to-comparators.js +0 -8
  244. package/node_modules/semver/ranges/valid.js +0 -11
  245. package/node_modules/simple-concat/.travis.yml +0 -3
  246. package/node_modules/simple-concat/LICENSE +0 -20
  247. package/node_modules/simple-concat/README.md +0 -44
  248. package/node_modules/simple-concat/index.js +0 -15
  249. package/node_modules/simple-concat/package.json +0 -47
  250. package/node_modules/simple-concat/test/basic.js +0 -41
  251. package/node_modules/simple-get/.github/dependabot.yml +0 -15
  252. package/node_modules/simple-get/.github/workflows/ci.yml +0 -23
  253. package/node_modules/simple-get/LICENSE +0 -20
  254. package/node_modules/simple-get/README.md +0 -333
  255. package/node_modules/simple-get/index.js +0 -108
  256. package/node_modules/simple-get/package.json +0 -67
  257. package/node_modules/tar-fs/.travis.yml +0 -6
  258. package/node_modules/tar-fs/LICENSE +0 -21
  259. package/node_modules/tar-fs/README.md +0 -165
  260. package/node_modules/tar-fs/index.js +0 -351
  261. package/node_modules/tar-fs/node_modules/bl/.travis.yml +0 -17
  262. package/node_modules/tar-fs/node_modules/bl/BufferList.js +0 -396
  263. package/node_modules/tar-fs/node_modules/bl/LICENSE.md +0 -13
  264. package/node_modules/tar-fs/node_modules/bl/README.md +0 -247
  265. package/node_modules/tar-fs/node_modules/bl/bl.js +0 -84
  266. package/node_modules/tar-fs/node_modules/bl/package.json +0 -37
  267. package/node_modules/tar-fs/node_modules/bl/test/convert.js +0 -21
  268. package/node_modules/tar-fs/node_modules/bl/test/indexOf.js +0 -492
  269. package/node_modules/tar-fs/node_modules/bl/test/isBufferList.js +0 -32
  270. package/node_modules/tar-fs/node_modules/bl/test/test.js +0 -869
  271. package/node_modules/tar-fs/node_modules/readable-stream/CONTRIBUTING.md +0 -38
  272. package/node_modules/tar-fs/node_modules/readable-stream/GOVERNANCE.md +0 -136
  273. package/node_modules/tar-fs/node_modules/readable-stream/LICENSE +0 -47
  274. package/node_modules/tar-fs/node_modules/readable-stream/README.md +0 -106
  275. package/node_modules/tar-fs/node_modules/readable-stream/errors-browser.js +0 -127
  276. package/node_modules/tar-fs/node_modules/readable-stream/errors.js +0 -116
  277. package/node_modules/tar-fs/node_modules/readable-stream/experimentalWarning.js +0 -17
  278. package/node_modules/tar-fs/node_modules/readable-stream/lib/_stream_duplex.js +0 -126
  279. package/node_modules/tar-fs/node_modules/readable-stream/lib/_stream_passthrough.js +0 -37
  280. package/node_modules/tar-fs/node_modules/readable-stream/lib/_stream_readable.js +0 -1027
  281. package/node_modules/tar-fs/node_modules/readable-stream/lib/_stream_transform.js +0 -190
  282. package/node_modules/tar-fs/node_modules/readable-stream/lib/_stream_writable.js +0 -641
  283. package/node_modules/tar-fs/node_modules/readable-stream/lib/internal/streams/async_iterator.js +0 -180
  284. package/node_modules/tar-fs/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -183
  285. package/node_modules/tar-fs/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -96
  286. package/node_modules/tar-fs/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -86
  287. package/node_modules/tar-fs/node_modules/readable-stream/lib/internal/streams/from-browser.js +0 -3
  288. package/node_modules/tar-fs/node_modules/readable-stream/lib/internal/streams/from.js +0 -52
  289. package/node_modules/tar-fs/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -86
  290. package/node_modules/tar-fs/node_modules/readable-stream/lib/internal/streams/state.js +0 -22
  291. package/node_modules/tar-fs/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
  292. package/node_modules/tar-fs/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
  293. package/node_modules/tar-fs/node_modules/readable-stream/package.json +0 -68
  294. package/node_modules/tar-fs/node_modules/readable-stream/readable-browser.js +0 -9
  295. package/node_modules/tar-fs/node_modules/readable-stream/readable.js +0 -16
  296. package/node_modules/tar-fs/node_modules/string_decoder/LICENSE +0 -48
  297. package/node_modules/tar-fs/node_modules/string_decoder/README.md +0 -47
  298. package/node_modules/tar-fs/node_modules/string_decoder/lib/string_decoder.js +0 -296
  299. package/node_modules/tar-fs/node_modules/string_decoder/package.json +0 -34
  300. package/node_modules/tar-fs/node_modules/tar-stream/LICENSE +0 -21
  301. package/node_modules/tar-fs/node_modules/tar-stream/README.md +0 -168
  302. package/node_modules/tar-fs/node_modules/tar-stream/extract.js +0 -257
  303. package/node_modules/tar-fs/node_modules/tar-stream/headers.js +0 -295
  304. package/node_modules/tar-fs/node_modules/tar-stream/index.js +0 -2
  305. package/node_modules/tar-fs/node_modules/tar-stream/pack.js +0 -255
  306. package/node_modules/tar-fs/node_modules/tar-stream/package.json +0 -58
  307. package/node_modules/tar-fs/node_modules/tar-stream/sandbox.js +0 -11
  308. package/node_modules/tar-fs/package.json +0 -41
  309. package/node_modules/tar-fs/test/fixtures/a/hello.txt +0 -1
  310. package/node_modules/tar-fs/test/fixtures/b/a/test.txt +0 -1
  311. package/node_modules/tar-fs/test/fixtures/d/file1 +0 -0
  312. package/node_modules/tar-fs/test/fixtures/d/file2 +0 -0
  313. package/node_modules/tar-fs/test/fixtures/d/sub-dir/file5 +0 -0
  314. package/node_modules/tar-fs/test/fixtures/d/sub-files/file3 +0 -0
  315. package/node_modules/tar-fs/test/fixtures/d/sub-files/file4 +0 -0
  316. package/node_modules/tar-fs/test/fixtures/e/directory/.ignore +0 -0
  317. package/node_modules/tar-fs/test/fixtures/e/file +0 -0
  318. package/node_modules/tar-fs/test/fixtures/invalid.tar +0 -0
  319. package/node_modules/tar-fs/test/index.js +0 -346
  320. package/node_modules/tunnel-agent/LICENSE +0 -55
  321. package/node_modules/tunnel-agent/README.md +0 -4
  322. package/node_modules/tunnel-agent/index.js +0 -244
  323. package/node_modules/tunnel-agent/package.json +0 -22
  324. package/node_modules/util-deprecate/History.md +0 -16
  325. package/node_modules/util-deprecate/LICENSE +0 -24
  326. package/node_modules/util-deprecate/README.md +0 -53
  327. package/node_modules/util-deprecate/browser.js +0 -67
  328. package/node_modules/util-deprecate/node.js +0 -6
  329. package/node_modules/util-deprecate/package.json +0 -27
  330. package/node_modules/wrappy/LICENSE +0 -15
  331. package/node_modules/wrappy/README.md +0 -36
  332. package/node_modules/wrappy/package.json +0 -29
  333. package/node_modules/wrappy/wrappy.js +0 -33
@@ -1,80 +0,0 @@
1
- const SemVer = require('../classes/semver')
2
- const Comparator = require('../classes/comparator')
3
- const { ANY } = Comparator
4
- const Range = require('../classes/range')
5
- const satisfies = require('../functions/satisfies')
6
- const gt = require('../functions/gt')
7
- const lt = require('../functions/lt')
8
- const lte = require('../functions/lte')
9
- const gte = require('../functions/gte')
10
-
11
- const outside = (version, range, hilo, options) => {
12
- version = new SemVer(version, options)
13
- range = new Range(range, options)
14
-
15
- let gtfn, ltefn, ltfn, comp, ecomp
16
- switch (hilo) {
17
- case '>':
18
- gtfn = gt
19
- ltefn = lte
20
- ltfn = lt
21
- comp = '>'
22
- ecomp = '>='
23
- break
24
- case '<':
25
- gtfn = lt
26
- ltefn = gte
27
- ltfn = gt
28
- comp = '<'
29
- ecomp = '<='
30
- break
31
- default:
32
- throw new TypeError('Must provide a hilo val of "<" or ">"')
33
- }
34
-
35
- // If it satisfies the range it is not outside
36
- if (satisfies(version, range, options)) {
37
- return false
38
- }
39
-
40
- // From now on, variable terms are as if we're in "gtr" mode.
41
- // but note that everything is flipped for the "ltr" function.
42
-
43
- for (let i = 0; i < range.set.length; ++i) {
44
- const comparators = range.set[i]
45
-
46
- let high = null
47
- let low = null
48
-
49
- comparators.forEach((comparator) => {
50
- if (comparator.semver === ANY) {
51
- comparator = new Comparator('>=0.0.0')
52
- }
53
- high = high || comparator
54
- low = low || comparator
55
- if (gtfn(comparator.semver, high.semver, options)) {
56
- high = comparator
57
- } else if (ltfn(comparator.semver, low.semver, options)) {
58
- low = comparator
59
- }
60
- })
61
-
62
- // If the edge version comparator has a operator then our version
63
- // isn't outside it
64
- if (high.operator === comp || high.operator === ecomp) {
65
- return false
66
- }
67
-
68
- // If the lowest version comparator has an operator and our version
69
- // is less than it then it isn't higher than the range
70
- if ((!low.operator || low.operator === comp) &&
71
- ltefn(version, low.semver)) {
72
- return false
73
- } else if (low.operator === ecomp && ltfn(version, low.semver)) {
74
- return false
75
- }
76
- }
77
- return true
78
- }
79
-
80
- module.exports = outside
@@ -1,47 +0,0 @@
1
- // given a set of versions and a range, create a "simplified" range
2
- // that includes the same versions that the original range does
3
- // If the original range is shorter than the simplified one, return that.
4
- const satisfies = require('../functions/satisfies.js')
5
- const compare = require('../functions/compare.js')
6
- module.exports = (versions, range, options) => {
7
- const set = []
8
- let first = null
9
- let prev = null
10
- const v = versions.sort((a, b) => compare(a, b, options))
11
- for (const version of v) {
12
- const included = satisfies(version, range, options)
13
- if (included) {
14
- prev = version
15
- if (!first) {
16
- first = version
17
- }
18
- } else {
19
- if (prev) {
20
- set.push([first, prev])
21
- }
22
- prev = null
23
- first = null
24
- }
25
- }
26
- if (first) {
27
- set.push([first, null])
28
- }
29
-
30
- const ranges = []
31
- for (const [min, max] of set) {
32
- if (min === max) {
33
- ranges.push(min)
34
- } else if (!max && min === v[0]) {
35
- ranges.push('*')
36
- } else if (!max) {
37
- ranges.push(`>=${min}`)
38
- } else if (min === v[0]) {
39
- ranges.push(`<=${max}`)
40
- } else {
41
- ranges.push(`${min} - ${max}`)
42
- }
43
- }
44
- const simplified = ranges.join(' || ')
45
- const original = typeof range.raw === 'string' ? range.raw : String(range)
46
- return simplified.length < original.length ? simplified : range
47
- }
@@ -1,247 +0,0 @@
1
- const Range = require('../classes/range.js')
2
- const Comparator = require('../classes/comparator.js')
3
- const { ANY } = Comparator
4
- const satisfies = require('../functions/satisfies.js')
5
- const compare = require('../functions/compare.js')
6
-
7
- // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
8
- // - Every simple range `r1, r2, ...` is a null set, OR
9
- // - Every simple range `r1, r2, ...` which is not a null set is a subset of
10
- // some `R1, R2, ...`
11
- //
12
- // Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:
13
- // - If c is only the ANY comparator
14
- // - If C is only the ANY comparator, return true
15
- // - Else if in prerelease mode, return false
16
- // - else replace c with `[>=0.0.0]`
17
- // - If C is only the ANY comparator
18
- // - if in prerelease mode, return true
19
- // - else replace C with `[>=0.0.0]`
20
- // - Let EQ be the set of = comparators in c
21
- // - If EQ is more than one, return true (null set)
22
- // - Let GT be the highest > or >= comparator in c
23
- // - Let LT be the lowest < or <= comparator in c
24
- // - If GT and LT, and GT.semver > LT.semver, return true (null set)
25
- // - If any C is a = range, and GT or LT are set, return false
26
- // - If EQ
27
- // - If GT, and EQ does not satisfy GT, return true (null set)
28
- // - If LT, and EQ does not satisfy LT, return true (null set)
29
- // - If EQ satisfies every C, return true
30
- // - Else return false
31
- // - If GT
32
- // - If GT.semver is lower than any > or >= comp in C, return false
33
- // - If GT is >=, and GT.semver does not satisfy every C, return false
34
- // - If GT.semver has a prerelease, and not in prerelease mode
35
- // - If no C has a prerelease and the GT.semver tuple, return false
36
- // - If LT
37
- // - If LT.semver is greater than any < or <= comp in C, return false
38
- // - If LT is <=, and LT.semver does not satisfy every C, return false
39
- // - If GT.semver has a prerelease, and not in prerelease mode
40
- // - If no C has a prerelease and the LT.semver tuple, return false
41
- // - Else return true
42
-
43
- const subset = (sub, dom, options = {}) => {
44
- if (sub === dom) {
45
- return true
46
- }
47
-
48
- sub = new Range(sub, options)
49
- dom = new Range(dom, options)
50
- let sawNonNull = false
51
-
52
- OUTER: for (const simpleSub of sub.set) {
53
- for (const simpleDom of dom.set) {
54
- const isSub = simpleSubset(simpleSub, simpleDom, options)
55
- sawNonNull = sawNonNull || isSub !== null
56
- if (isSub) {
57
- continue OUTER
58
- }
59
- }
60
- // the null set is a subset of everything, but null simple ranges in
61
- // a complex range should be ignored. so if we saw a non-null range,
62
- // then we know this isn't a subset, but if EVERY simple range was null,
63
- // then it is a subset.
64
- if (sawNonNull) {
65
- return false
66
- }
67
- }
68
- return true
69
- }
70
-
71
- const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')]
72
- const minimumVersion = [new Comparator('>=0.0.0')]
73
-
74
- const simpleSubset = (sub, dom, options) => {
75
- if (sub === dom) {
76
- return true
77
- }
78
-
79
- if (sub.length === 1 && sub[0].semver === ANY) {
80
- if (dom.length === 1 && dom[0].semver === ANY) {
81
- return true
82
- } else if (options.includePrerelease) {
83
- sub = minimumVersionWithPreRelease
84
- } else {
85
- sub = minimumVersion
86
- }
87
- }
88
-
89
- if (dom.length === 1 && dom[0].semver === ANY) {
90
- if (options.includePrerelease) {
91
- return true
92
- } else {
93
- dom = minimumVersion
94
- }
95
- }
96
-
97
- const eqSet = new Set()
98
- let gt, lt
99
- for (const c of sub) {
100
- if (c.operator === '>' || c.operator === '>=') {
101
- gt = higherGT(gt, c, options)
102
- } else if (c.operator === '<' || c.operator === '<=') {
103
- lt = lowerLT(lt, c, options)
104
- } else {
105
- eqSet.add(c.semver)
106
- }
107
- }
108
-
109
- if (eqSet.size > 1) {
110
- return null
111
- }
112
-
113
- let gtltComp
114
- if (gt && lt) {
115
- gtltComp = compare(gt.semver, lt.semver, options)
116
- if (gtltComp > 0) {
117
- return null
118
- } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {
119
- return null
120
- }
121
- }
122
-
123
- // will iterate one or zero times
124
- for (const eq of eqSet) {
125
- if (gt && !satisfies(eq, String(gt), options)) {
126
- return null
127
- }
128
-
129
- if (lt && !satisfies(eq, String(lt), options)) {
130
- return null
131
- }
132
-
133
- for (const c of dom) {
134
- if (!satisfies(eq, String(c), options)) {
135
- return false
136
- }
137
- }
138
-
139
- return true
140
- }
141
-
142
- let higher, lower
143
- let hasDomLT, hasDomGT
144
- // if the subset has a prerelease, we need a comparator in the superset
145
- // with the same tuple and a prerelease, or it's not a subset
146
- let needDomLTPre = lt &&
147
- !options.includePrerelease &&
148
- lt.semver.prerelease.length ? lt.semver : false
149
- let needDomGTPre = gt &&
150
- !options.includePrerelease &&
151
- gt.semver.prerelease.length ? gt.semver : false
152
- // exception: <1.2.3-0 is the same as <1.2.3
153
- if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&
154
- lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {
155
- needDomLTPre = false
156
- }
157
-
158
- for (const c of dom) {
159
- hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='
160
- hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='
161
- if (gt) {
162
- if (needDomGTPre) {
163
- if (c.semver.prerelease && c.semver.prerelease.length &&
164
- c.semver.major === needDomGTPre.major &&
165
- c.semver.minor === needDomGTPre.minor &&
166
- c.semver.patch === needDomGTPre.patch) {
167
- needDomGTPre = false
168
- }
169
- }
170
- if (c.operator === '>' || c.operator === '>=') {
171
- higher = higherGT(gt, c, options)
172
- if (higher === c && higher !== gt) {
173
- return false
174
- }
175
- } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {
176
- return false
177
- }
178
- }
179
- if (lt) {
180
- if (needDomLTPre) {
181
- if (c.semver.prerelease && c.semver.prerelease.length &&
182
- c.semver.major === needDomLTPre.major &&
183
- c.semver.minor === needDomLTPre.minor &&
184
- c.semver.patch === needDomLTPre.patch) {
185
- needDomLTPre = false
186
- }
187
- }
188
- if (c.operator === '<' || c.operator === '<=') {
189
- lower = lowerLT(lt, c, options)
190
- if (lower === c && lower !== lt) {
191
- return false
192
- }
193
- } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {
194
- return false
195
- }
196
- }
197
- if (!c.operator && (lt || gt) && gtltComp !== 0) {
198
- return false
199
- }
200
- }
201
-
202
- // if there was a < or >, and nothing in the dom, then must be false
203
- // UNLESS it was limited by another range in the other direction.
204
- // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
205
- if (gt && hasDomLT && !lt && gtltComp !== 0) {
206
- return false
207
- }
208
-
209
- if (lt && hasDomGT && !gt && gtltComp !== 0) {
210
- return false
211
- }
212
-
213
- // we needed a prerelease range in a specific tuple, but didn't get one
214
- // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,
215
- // because it includes prereleases in the 1.2.3 tuple
216
- if (needDomGTPre || needDomLTPre) {
217
- return false
218
- }
219
-
220
- return true
221
- }
222
-
223
- // >=1.2.3 is lower than >1.2.3
224
- const higherGT = (a, b, options) => {
225
- if (!a) {
226
- return b
227
- }
228
- const comp = compare(a.semver, b.semver, options)
229
- return comp > 0 ? a
230
- : comp < 0 ? b
231
- : b.operator === '>' && a.operator === '>=' ? b
232
- : a
233
- }
234
-
235
- // <=1.2.3 is higher than <1.2.3
236
- const lowerLT = (a, b, options) => {
237
- if (!a) {
238
- return b
239
- }
240
- const comp = compare(a.semver, b.semver, options)
241
- return comp < 0 ? a
242
- : comp > 0 ? b
243
- : b.operator === '<' && a.operator === '<=' ? b
244
- : a
245
- }
246
-
247
- module.exports = subset
@@ -1,8 +0,0 @@
1
- const Range = require('../classes/range')
2
-
3
- // Mostly just for testing and legacy API reasons
4
- const toComparators = (range, options) =>
5
- new Range(range, options).set
6
- .map(comp => comp.map(c => c.value).join(' ').trim().split(' '))
7
-
8
- module.exports = toComparators
@@ -1,11 +0,0 @@
1
- const Range = require('../classes/range')
2
- const validRange = (range, options) => {
3
- try {
4
- // Return '*' instead of '' so that truthiness works.
5
- // This will throw if it's invalid anyway
6
- return new Range(range, options).range || '*'
7
- } catch (er) {
8
- return null
9
- }
10
- }
11
- module.exports = validRange
@@ -1,3 +0,0 @@
1
- language: node_js
2
- node_js:
3
- - lts/*
@@ -1,20 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) Feross Aboukhadijeh
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of
6
- this software and associated documentation files (the "Software"), to deal in
7
- the Software without restriction, including without limitation the rights to
8
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
- the Software, and to permit persons to whom the Software is furnished to do so,
10
- subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,44 +0,0 @@
1
- # simple-concat [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
2
-
3
- [travis-image]: https://img.shields.io/travis/feross/simple-concat/master.svg
4
- [travis-url]: https://travis-ci.org/feross/simple-concat
5
- [npm-image]: https://img.shields.io/npm/v/simple-concat.svg
6
- [npm-url]: https://npmjs.org/package/simple-concat
7
- [downloads-image]: https://img.shields.io/npm/dm/simple-concat.svg
8
- [downloads-url]: https://npmjs.org/package/simple-concat
9
- [standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
10
- [standard-url]: https://standardjs.com
11
-
12
- ### Super-minimalist version of [`concat-stream`](https://github.com/maxogden/concat-stream). Less than 15 lines!
13
-
14
- ## install
15
-
16
- ```
17
- npm install simple-concat
18
- ```
19
-
20
- ## usage
21
-
22
- This example is longer than the implementation.
23
-
24
- ```js
25
- var s = new stream.PassThrough()
26
- concat(s, function (err, buf) {
27
- if (err) throw err
28
- console.error(buf)
29
- })
30
- s.write('abc')
31
- setTimeout(function () {
32
- s.write('123')
33
- }, 10)
34
- setTimeout(function () {
35
- s.write('456')
36
- }, 20)
37
- setTimeout(function () {
38
- s.end('789')
39
- }, 30)
40
- ```
41
-
42
- ## license
43
-
44
- MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).
@@ -1,15 +0,0 @@
1
- /*! simple-concat. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
2
- module.exports = function (stream, cb) {
3
- var chunks = []
4
- stream.on('data', function (chunk) {
5
- chunks.push(chunk)
6
- })
7
- stream.once('end', function () {
8
- if (cb) cb(null, Buffer.concat(chunks))
9
- cb = null
10
- })
11
- stream.once('error', function (err) {
12
- if (cb) cb(err)
13
- cb = null
14
- })
15
- }
@@ -1,47 +0,0 @@
1
- {
2
- "name": "simple-concat",
3
- "description": "Super-minimalist version of `concat-stream`. Less than 15 lines!",
4
- "version": "1.0.1",
5
- "author": {
6
- "name": "Feross Aboukhadijeh",
7
- "email": "feross@feross.org",
8
- "url": "https://feross.org"
9
- },
10
- "bugs": {
11
- "url": "https://github.com/feross/simple-concat/issues"
12
- },
13
- "dependencies": {},
14
- "devDependencies": {
15
- "standard": "*",
16
- "tape": "^5.0.1"
17
- },
18
- "homepage": "https://github.com/feross/simple-concat",
19
- "keywords": [
20
- "concat",
21
- "concat-stream",
22
- "concat stream"
23
- ],
24
- "license": "MIT",
25
- "main": "index.js",
26
- "repository": {
27
- "type": "git",
28
- "url": "git://github.com/feross/simple-concat.git"
29
- },
30
- "scripts": {
31
- "test": "standard && tape test/*.js"
32
- },
33
- "funding": [
34
- {
35
- "type": "github",
36
- "url": "https://github.com/sponsors/feross"
37
- },
38
- {
39
- "type": "patreon",
40
- "url": "https://www.patreon.com/feross"
41
- },
42
- {
43
- "type": "consulting",
44
- "url": "https://feross.org/support"
45
- }
46
- ]
47
- }
@@ -1,41 +0,0 @@
1
- var concat = require('../')
2
- var stream = require('stream')
3
- var test = require('tape')
4
-
5
- test('basic', function (t) {
6
- t.plan(2)
7
- var s = new stream.PassThrough()
8
- concat(s, function (err, buf) {
9
- t.error(err)
10
- t.deepEqual(buf, Buffer.from('abc123456789'))
11
- })
12
- s.write('abc')
13
- setTimeout(function () {
14
- s.write('123')
15
- }, 10)
16
- setTimeout(function () {
17
- s.write('456')
18
- }, 20)
19
- setTimeout(function () {
20
- s.end('789')
21
- }, 30)
22
- })
23
-
24
- test('error', function (t) {
25
- t.plan(2)
26
- var s = new stream.PassThrough()
27
- concat(s, function (err, buf) {
28
- t.ok(err, 'got expected error')
29
- t.ok(!buf)
30
- })
31
- s.write('abc')
32
- setTimeout(function () {
33
- s.write('123')
34
- }, 10)
35
- setTimeout(function () {
36
- s.write('456')
37
- }, 20)
38
- setTimeout(function () {
39
- s.emit('error', new Error('error'))
40
- }, 30)
41
- })
@@ -1,15 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: npm
4
- directory: /
5
- schedule:
6
- interval: daily
7
- labels:
8
- - dependency
9
- versioning-strategy: increase-if-necessary
10
- - package-ecosystem: github-actions
11
- directory: /
12
- schedule:
13
- interval: daily
14
- labels:
15
- - dependency
@@ -1,23 +0,0 @@
1
- name: ci
2
- 'on':
3
- - push
4
- - pull_request
5
- jobs:
6
- test:
7
- name: Node ${{ matrix.node }} / ${{ matrix.os }}
8
- runs-on: ${{ matrix.os }}
9
- strategy:
10
- fail-fast: false
11
- matrix:
12
- os:
13
- - ubuntu-latest
14
- node:
15
- - '14'
16
- steps:
17
- - uses: actions/checkout@v2
18
- - uses: actions/setup-node@v2
19
- with:
20
- node-version: ${{ matrix.node }}
21
- - run: npm install
22
- - run: npm run build --if-present
23
- - run: npm test
@@ -1,20 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) Feross Aboukhadijeh
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of
6
- this software and associated documentation files (the "Software"), to deal in
7
- the Software without restriction, including without limitation the rights to
8
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
- the Software, and to permit persons to whom the Software is furnished to do so,
10
- subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.