isomorfeus-puppetmaster 0.5.0 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (317) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -13
  3. data/lib/isomorfeus/puppetmaster/driver/puppeteer.rb +3 -3
  4. data/lib/isomorfeus/puppetmaster/driver/puppeteer_document.rb +30 -30
  5. data/lib/isomorfeus/puppetmaster/driver/puppeteer_node.rb +4 -4
  6. data/lib/isomorfeus/puppetmaster/node.rb +3 -3
  7. data/lib/isomorfeus/puppetmaster/server.rb +1 -1
  8. data/lib/isomorfeus/puppetmaster/server_registration.rb +3 -3
  9. data/lib/isomorfeus/puppetmaster/version.rb +1 -1
  10. data/lib/isomorfeus/puppetmaster.rb +2 -2
  11. data/lib/isomorfeus-puppetmaster.rb +8 -2
  12. data/node_modules/.package-lock.json +56 -45
  13. data/node_modules/debug/package.json +1 -1
  14. data/node_modules/debug/src/common.js +14 -1
  15. data/node_modules/{mkdirp → mkdirp-classic}/LICENSE +2 -2
  16. data/node_modules/mkdirp-classic/README.md +18 -0
  17. data/node_modules/{mkdirp → mkdirp-classic}/index.js +2 -3
  18. data/node_modules/mkdirp-classic/package.json +18 -0
  19. data/node_modules/node-fetch/lib/index.es.js +25 -3
  20. data/node_modules/node-fetch/lib/index.js +25 -3
  21. data/node_modules/node-fetch/lib/index.mjs +25 -3
  22. data/node_modules/node-fetch/package.json +8 -6
  23. data/node_modules/progress/lib/node-progress.js +4 -3
  24. data/node_modules/progress/package.json +1 -1
  25. data/node_modules/puppeteer-core/CHANGELOG.md +64 -0
  26. data/node_modules/puppeteer-core/README.md +13 -15
  27. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/AriaQueryHandler.d.ts.map +1 -1
  28. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/AriaQueryHandler.js +5 -5
  29. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/AriaQueryHandler.js.map +1 -1
  30. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Browser.d.ts +20 -2
  31. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Browser.d.ts.map +1 -1
  32. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Browser.js +20 -7
  33. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Browser.js.map +1 -1
  34. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/BrowserConnector.js +2 -2
  35. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -1
  36. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.d.ts +8 -2
  37. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.d.ts.map +1 -1
  38. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js +26 -8
  39. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js.map +1 -1
  40. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Coverage.d.ts +18 -2
  41. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Coverage.d.ts.map +1 -1
  42. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Coverage.js +16 -9
  43. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Coverage.js.map +1 -1
  44. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DOMWorld.d.ts +4 -1
  45. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DOMWorld.d.ts.map +1 -1
  46. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DOMWorld.js +26 -18
  47. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DOMWorld.js.map +1 -1
  48. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DeviceDescriptors.d.ts.map +1 -1
  49. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DeviceDescriptors.js +120 -0
  50. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DeviceDescriptors.js.map +1 -1
  51. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Dialog.js +2 -2
  52. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Dialog.js.map +1 -1
  53. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Errors.d.ts +10 -1
  54. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Errors.d.ts.map +1 -1
  55. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Errors.js +9 -1
  56. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Errors.js.map +1 -1
  57. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EvalTypes.d.ts +1 -1
  58. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EvalTypes.d.ts.map +1 -1
  59. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EventEmitter.js +1 -1
  60. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EventEmitter.js.map +1 -1
  61. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js +8 -8
  62. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js.map +1 -1
  63. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/FileChooser.js +2 -2
  64. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/FileChooser.js.map +1 -1
  65. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/FrameManager.d.ts +21 -9
  66. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/FrameManager.d.ts.map +1 -1
  67. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/FrameManager.js +157 -74
  68. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/FrameManager.js.map +1 -1
  69. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/HTTPRequest.d.ts +5 -0
  70. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/HTTPRequest.d.ts.map +1 -1
  71. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/HTTPRequest.js +32 -29
  72. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/HTTPRequest.js.map +1 -1
  73. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/HTTPResponse.d.ts.map +1 -1
  74. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/HTTPResponse.js +14 -4
  75. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/HTTPResponse.js.map +1 -1
  76. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Input.d.ts +2 -3
  77. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Input.d.ts.map +1 -1
  78. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Input.js +3 -4
  79. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Input.js.map +1 -1
  80. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/JSHandle.d.ts +27 -5
  81. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/JSHandle.d.ts.map +1 -1
  82. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/JSHandle.js +46 -21
  83. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/JSHandle.js.map +1 -1
  84. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/LifecycleWatcher.js +1 -1
  85. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/LifecycleWatcher.js.map +1 -1
  86. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/NetworkManager.d.ts +1 -0
  87. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/NetworkManager.d.ts.map +1 -1
  88. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/NetworkManager.js +7 -5
  89. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/NetworkManager.js.map +1 -1
  90. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/PDFOptions.d.ts +5 -0
  91. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/PDFOptions.d.ts.map +1 -1
  92. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/PDFOptions.js.map +1 -1
  93. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.d.ts +51 -6
  94. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.d.ts.map +1 -1
  95. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.js +157 -50
  96. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.js.map +1 -1
  97. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Puppeteer.js +5 -5
  98. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Puppeteer.js.map +1 -1
  99. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Target.d.ts +3 -1
  100. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Target.d.ts.map +1 -1
  101. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Target.js +3 -2
  102. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Target.js.map +1 -1
  103. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/TaskQueue.d.ts +21 -0
  104. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/TaskQueue.d.ts.map +1 -0
  105. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/TaskQueue.js +30 -0
  106. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/TaskQueue.js.map +1 -0
  107. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Tracing.d.ts.map +1 -1
  108. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Tracing.js +9 -3
  109. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Tracing.js.map +1 -1
  110. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/assert.d.ts +1 -0
  111. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/assert.d.ts.map +1 -1
  112. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/assert.js +6 -1
  113. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/assert.js.map +1 -1
  114. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/helper.js +5 -5
  115. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/helper.js.map +1 -1
  116. data/node_modules/puppeteer-core/lib/cjs/puppeteer/global.d.ts +17 -0
  117. data/node_modules/puppeteer-core/lib/cjs/puppeteer/global.d.ts.map +1 -0
  118. data/node_modules/puppeteer-core/lib/cjs/puppeteer/global.js +3 -0
  119. data/node_modules/puppeteer-core/lib/cjs/puppeteer/global.js.map +1 -0
  120. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserFetcher.d.ts.map +1 -1
  121. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserFetcher.js +20 -21
  122. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserFetcher.js.map +1 -1
  123. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.d.ts.map +1 -1
  124. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js +11 -5
  125. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js.map +1 -1
  126. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/LaunchOptions.d.ts +6 -2
  127. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/LaunchOptions.d.ts.map +1 -1
  128. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/Launcher.d.ts.map +1 -1
  129. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/Launcher.js +30 -15
  130. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/Launcher.js.map +1 -1
  131. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/NodeWebSocketTransport.d.ts.map +1 -1
  132. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/NodeWebSocketTransport.js +7 -1
  133. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/NodeWebSocketTransport.js.map +1 -1
  134. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/Puppeteer.js +1 -1
  135. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/Puppeteer.js.map +1 -1
  136. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/install.d.ts.map +1 -1
  137. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/install.js +17 -3
  138. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/install.js.map +1 -1
  139. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node-puppeteer-core.js +1 -1
  140. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node-puppeteer-core.js.map +1 -1
  141. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node.js +1 -1
  142. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node.js.map +1 -1
  143. data/node_modules/puppeteer-core/lib/cjs/puppeteer/web.js +1 -1
  144. data/node_modules/puppeteer-core/lib/cjs/puppeteer/web.js.map +1 -1
  145. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/AriaQueryHandler.d.ts.map +1 -1
  146. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/AriaQueryHandler.js +5 -5
  147. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/AriaQueryHandler.js.map +1 -1
  148. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Browser.d.ts +20 -2
  149. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Browser.d.ts.map +1 -1
  150. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Browser.js +16 -3
  151. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Browser.js.map +1 -1
  152. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Connection.d.ts +8 -2
  153. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Connection.d.ts.map +1 -1
  154. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Connection.js +23 -5
  155. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Connection.js.map +1 -1
  156. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Coverage.d.ts +18 -2
  157. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Coverage.d.ts.map +1 -1
  158. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Coverage.js +10 -3
  159. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Coverage.js.map +1 -1
  160. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DOMWorld.d.ts +4 -1
  161. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DOMWorld.d.ts.map +1 -1
  162. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DOMWorld.js +16 -8
  163. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DOMWorld.js.map +1 -1
  164. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DeviceDescriptors.d.ts.map +1 -1
  165. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DeviceDescriptors.js +120 -0
  166. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DeviceDescriptors.js.map +1 -1
  167. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Errors.d.ts +10 -1
  168. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Errors.d.ts.map +1 -1
  169. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Errors.js +7 -0
  170. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Errors.js.map +1 -1
  171. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/EvalTypes.d.ts +1 -1
  172. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/EvalTypes.d.ts.map +1 -1
  173. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/FrameManager.d.ts +21 -9
  174. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/FrameManager.d.ts.map +1 -1
  175. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/FrameManager.js +152 -69
  176. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/FrameManager.js.map +1 -1
  177. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/HTTPRequest.d.ts +5 -0
  178. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/HTTPRequest.d.ts.map +1 -1
  179. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/HTTPRequest.js +22 -19
  180. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/HTTPRequest.js.map +1 -1
  181. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/HTTPResponse.d.ts.map +1 -1
  182. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/HTTPResponse.js +14 -4
  183. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/HTTPResponse.js.map +1 -1
  184. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Input.d.ts +2 -3
  185. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Input.d.ts.map +1 -1
  186. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Input.js +2 -3
  187. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Input.js.map +1 -1
  188. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/JSHandle.d.ts +27 -5
  189. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -1
  190. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/JSHandle.js +35 -10
  191. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/JSHandle.js.map +1 -1
  192. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/NetworkManager.d.ts +1 -0
  193. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/NetworkManager.d.ts.map +1 -1
  194. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/NetworkManager.js +6 -4
  195. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/NetworkManager.js.map +1 -1
  196. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/PDFOptions.d.ts +5 -0
  197. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/PDFOptions.d.ts.map +1 -1
  198. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/PDFOptions.js.map +1 -1
  199. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Page.d.ts +51 -6
  200. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Page.d.ts.map +1 -1
  201. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Page.js +136 -29
  202. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Page.js.map +1 -1
  203. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Target.d.ts +3 -1
  204. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Target.d.ts.map +1 -1
  205. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Target.js +3 -2
  206. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Target.js.map +1 -1
  207. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/TaskQueue.d.ts +21 -0
  208. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/TaskQueue.d.ts.map +1 -0
  209. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/TaskQueue.js +26 -0
  210. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/TaskQueue.js.map +1 -0
  211. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Tracing.d.ts.map +1 -1
  212. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Tracing.js +8 -2
  213. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Tracing.js.map +1 -1
  214. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/assert.d.ts +1 -0
  215. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/assert.d.ts.map +1 -1
  216. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/assert.js +4 -0
  217. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/assert.js.map +1 -1
  218. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/helper.js +1 -1
  219. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/helper.js.map +1 -1
  220. data/node_modules/puppeteer-core/lib/esm/puppeteer/global.d.ts +17 -0
  221. data/node_modules/puppeteer-core/lib/esm/puppeteer/global.d.ts.map +1 -0
  222. data/node_modules/puppeteer-core/lib/esm/puppeteer/global.js +2 -0
  223. data/node_modules/puppeteer-core/lib/esm/puppeteer/global.js.map +1 -0
  224. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserFetcher.d.ts.map +1 -1
  225. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserFetcher.js +9 -10
  226. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserFetcher.js.map +1 -1
  227. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserRunner.d.ts.map +1 -1
  228. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserRunner.js +7 -1
  229. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserRunner.js.map +1 -1
  230. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/LaunchOptions.d.ts +6 -2
  231. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/LaunchOptions.d.ts.map +1 -1
  232. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/Launcher.d.ts.map +1 -1
  233. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/Launcher.js +27 -12
  234. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/Launcher.js.map +1 -1
  235. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts.map +1 -1
  236. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/NodeWebSocketTransport.js +7 -1
  237. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/NodeWebSocketTransport.js.map +1 -1
  238. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/install.d.ts.map +1 -1
  239. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/install.js +17 -3
  240. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/install.js.map +1 -1
  241. data/node_modules/puppeteer-core/lib/types.d.ts +3898 -3710
  242. data/node_modules/puppeteer-core/package.json +35 -41
  243. data/node_modules/tar-fs/.travis.yml +2 -1
  244. data/node_modules/tar-fs/README.md +4 -2
  245. data/node_modules/tar-fs/index.js +11 -8
  246. data/node_modules/tar-fs/package.json +4 -4
  247. data/node_modules/tar-fs/test/index.js +1 -1
  248. data/node_modules/tr46/.npmignore +4 -0
  249. data/node_modules/tr46/index.js +193 -0
  250. data/node_modules/tr46/lib/.gitkeep +0 -0
  251. data/node_modules/tr46/lib/mappingTable.json +1 -0
  252. data/node_modules/tr46/package.json +31 -0
  253. data/node_modules/unbzip2-stream/README.md +1 -1
  254. data/node_modules/unbzip2-stream/dist/unbzip2-stream.min.js +1 -1
  255. data/node_modules/unbzip2-stream/index.js +3 -2
  256. data/node_modules/unbzip2-stream/lib/bzip2.js +4 -6
  257. data/node_modules/unbzip2-stream/package.json +1 -1
  258. data/node_modules/webidl-conversions/LICENSE.md +12 -0
  259. data/node_modules/webidl-conversions/README.md +53 -0
  260. data/node_modules/webidl-conversions/lib/index.js +189 -0
  261. data/node_modules/webidl-conversions/package.json +23 -0
  262. data/node_modules/whatwg-url/LICENSE.txt +21 -0
  263. data/node_modules/whatwg-url/README.md +67 -0
  264. data/node_modules/whatwg-url/lib/URL-impl.js +200 -0
  265. data/node_modules/whatwg-url/lib/URL.js +196 -0
  266. data/node_modules/whatwg-url/lib/public-api.js +11 -0
  267. data/node_modules/whatwg-url/lib/url-state-machine.js +1297 -0
  268. data/node_modules/whatwg-url/lib/utils.js +20 -0
  269. data/node_modules/whatwg-url/package.json +32 -0
  270. data/node_modules/ws/LICENSE +0 -2
  271. data/node_modules/ws/README.md +49 -52
  272. data/node_modules/ws/index.js +3 -0
  273. data/node_modules/ws/lib/buffer-util.js +3 -6
  274. data/node_modules/ws/lib/constants.js +3 -1
  275. data/node_modules/ws/lib/event-target.js +172 -90
  276. data/node_modules/ws/lib/extension.js +8 -28
  277. data/node_modules/ws/lib/permessage-deflate.js +10 -16
  278. data/node_modules/ws/lib/receiver.js +143 -38
  279. data/node_modules/ws/lib/sender.js +29 -12
  280. data/node_modules/ws/lib/stream.js +20 -5
  281. data/node_modules/ws/lib/subprotocol.js +62 -0
  282. data/node_modules/ws/lib/validation.js +28 -8
  283. data/node_modules/ws/lib/websocket-server.js +129 -62
  284. data/node_modules/ws/lib/websocket.js +311 -104
  285. data/node_modules/ws/package.json +10 -5
  286. data/node_modules/ws/wrapper.mjs +8 -0
  287. data/package.json +1 -1
  288. metadata +79 -57
  289. data/node_modules/.bin/mkdirp +0 -12
  290. data/node_modules/.bin/mkdirp.cmd +0 -17
  291. data/node_modules/.bin/mkdirp.ps1 +0 -28
  292. data/node_modules/minimist/.travis.yml +0 -8
  293. data/node_modules/minimist/LICENSE +0 -18
  294. data/node_modules/minimist/example/parse.js +0 -2
  295. data/node_modules/minimist/index.js +0 -245
  296. data/node_modules/minimist/package.json +0 -45
  297. data/node_modules/minimist/readme.markdown +0 -95
  298. data/node_modules/minimist/test/all_bool.js +0 -32
  299. data/node_modules/minimist/test/bool.js +0 -178
  300. data/node_modules/minimist/test/dash.js +0 -31
  301. data/node_modules/minimist/test/default_bool.js +0 -35
  302. data/node_modules/minimist/test/dotted.js +0 -22
  303. data/node_modules/minimist/test/kv_short.js +0 -16
  304. data/node_modules/minimist/test/long.js +0 -31
  305. data/node_modules/minimist/test/num.js +0 -36
  306. data/node_modules/minimist/test/parse.js +0 -197
  307. data/node_modules/minimist/test/parse_modified.js +0 -9
  308. data/node_modules/minimist/test/proto.js +0 -44
  309. data/node_modules/minimist/test/short.js +0 -67
  310. data/node_modules/minimist/test/stop_early.js +0 -15
  311. data/node_modules/minimist/test/unknown.js +0 -102
  312. data/node_modules/minimist/test/whitespace.js +0 -8
  313. data/node_modules/mkdirp/bin/cmd.js +0 -33
  314. data/node_modules/mkdirp/bin/usage.txt +0 -12
  315. data/node_modules/mkdirp/package.json +0 -34
  316. data/node_modules/mkdirp/readme.markdown +0 -100
  317. data/node_modules/node-fetch/CHANGELOG.md +0 -272
@@ -241,8 +241,8 @@ bzip2.decompress = function(bits, stream, buf, bufsize, streamCRC) {
241
241
 
242
242
  hufGroup.minLen = minLen;
243
243
  hufGroup.maxLen = maxLen;
244
- var base = hufGroup.base.subarray(1);
245
- var limit = hufGroup.limit.subarray(1);
244
+ var base = hufGroup.base;
245
+ var limit = hufGroup.limit;
246
246
  var pp = 0;
247
247
  for(var i = minLen; i <= maxLen; i++)
248
248
  for(var t = 0; t < symCount; t++)
@@ -271,8 +271,8 @@ bzip2.decompress = function(bits, stream, buf, bufsize, streamCRC) {
271
271
  symCount = GROUP_SIZE - 1;
272
272
  if (selector >= nSelectors) message.Error("meow i'm a kitty, that's an error");
273
273
  hufGroup = groups[this.selectors[selector++]];
274
- base = hufGroup.base.subarray(1);
275
- limit = hufGroup.limit.subarray(1);
274
+ base = hufGroup.base;
275
+ limit = hufGroup.limit;
276
276
  }
277
277
  i = hufGroup.minLen;
278
278
  j = bits(i);
@@ -358,8 +358,6 @@ bzip2.decompress = function(bits, stream, buf, bufsize, streamCRC) {
358
358
 
359
359
  crc = (crc ^ (-1)) >>> 0;
360
360
  if ((crc|0) != (crcblock|0)) message.Error("Error in bzip2: crc32 do not match");
361
- if (streamCRC === null)
362
- streamCRC = 0;
363
361
  streamCRC = (crc ^ ((streamCRC << 1) | (streamCRC >>> 31))) & 0xFFFFFFFF;
364
362
  return streamCRC;
365
363
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unbzip2-stream",
3
- "version": "1.3.3",
3
+ "version": "1.4.3",
4
4
  "description": "streaming unbzip2 implementation in pure javascript for node and browsers",
5
5
  "keywords": [
6
6
  "bzip",
@@ -0,0 +1,12 @@
1
+ # The BSD 2-Clause License
2
+
3
+ Copyright (c) 2014, Domenic Denicola
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,53 @@
1
+ # WebIDL Type Conversions on JavaScript Values
2
+
3
+ This package implements, in JavaScript, the algorithms to convert a given JavaScript value according to a given [WebIDL](http://heycam.github.io/webidl/) [type](http://heycam.github.io/webidl/#idl-types).
4
+
5
+ The goal is that you should be able to write code like
6
+
7
+ ```js
8
+ const conversions = require("webidl-conversions");
9
+
10
+ function doStuff(x, y) {
11
+ x = conversions["boolean"](x);
12
+ y = conversions["unsigned long"](y);
13
+ // actual algorithm code here
14
+ }
15
+ ```
16
+
17
+ and your function `doStuff` will behave the same as a WebIDL operation declared as
18
+
19
+ ```webidl
20
+ void doStuff(boolean x, unsigned long y);
21
+ ```
22
+
23
+ ## API
24
+
25
+ This package's main module's default export is an object with a variety of methods, each corresponding to a different WebIDL type. Each method, when invoked on a JavaScript value, will give back the new JavaScript value that results after passing through the WebIDL conversion rules. (See below for more details on what that means.) Alternately, the method could throw an error, if the WebIDL algorithm is specified to do so: for example `conversions["float"](NaN)` [will throw a `TypeError`](http://heycam.github.io/webidl/#es-float).
26
+
27
+ ## Status
28
+
29
+ All of the numeric types are implemented (float being implemented as double) and some others are as well - check the source for all of them. This list will grow over time in service of the [HTML as Custom Elements](https://github.com/dglazkov/html-as-custom-elements) project, but in the meantime, pull requests welcome!
30
+
31
+ I'm not sure yet what the strategy will be for modifiers, e.g. [`[Clamp]`](http://heycam.github.io/webidl/#Clamp). Maybe something like `conversions["unsigned long"](x, { clamp: true })`? We'll see.
32
+
33
+ We might also want to extend the API to give better error messages, e.g. "Argument 1 of HTMLMediaElement.fastSeek is not a finite floating-point value" instead of "Argument is not a finite floating-point value." This would require passing in more information to the conversion functions than we currently do.
34
+
35
+ ## Background
36
+
37
+ What's actually going on here, conceptually, is pretty weird. Let's try to explain.
38
+
39
+ WebIDL, as part of its madness-inducing design, has its own type system. When people write algorithms in web platform specs, they usually operate on WebIDL values, i.e. instances of WebIDL types. For example, if they were specifying the algorithm for our `doStuff` operation above, they would treat `x` as a WebIDL value of [WebIDL type `boolean`](http://heycam.github.io/webidl/#idl-boolean). Crucially, they would _not_ treat `x` as a JavaScript variable whose value is either the JavaScript `true` or `false`. They're instead working in a different type system altogether, with its own rules.
40
+
41
+ Separately from its type system, WebIDL defines a ["binding"](http://heycam.github.io/webidl/#ecmascript-binding) of the type system into JavaScript. This contains rules like: when you pass a JavaScript value to the JavaScript method that manifests a given WebIDL operation, how does that get converted into a WebIDL value? For example, a JavaScript `true` passed in the position of a WebIDL `boolean` argument becomes a WebIDL `true`. But, a JavaScript `true` passed in the position of a [WebIDL `unsigned long`](http://heycam.github.io/webidl/#idl-unsigned-long) becomes a WebIDL `1`. And so on.
42
+
43
+ Finally, we have the actual implementation code. This is usually C++, although these days [some smart people are using Rust](https://github.com/servo/servo). The implementation, of course, has its own type system. So when they implement the WebIDL algorithms, they don't actually use WebIDL values, since those aren't "real" outside of specs. Instead, implementations apply the WebIDL binding rules in such a way as to convert incoming JavaScript values into C++ values. For example, if code in the browser called `doStuff(true, true)`, then the implementation code would eventually receive a C++ `bool` containing `true` and a C++ `uint32_t` containing `1`.
44
+
45
+ The upside of all this is that implementations can abstract all the conversion logic away, letting WebIDL handle it, and focus on implementing the relevant methods in C++ with values of the correct type already provided. That is payoff of WebIDL, in a nutshell.
46
+
47
+ And getting to that payoff is the goal of _this_ project—but for JavaScript implementations, instead of C++ ones. That is, this library is designed to make it easier for JavaScript developers to write functions that behave like a given WebIDL operation. So conceptually, the conversion pipeline, which in its general form is JavaScript values ↦ WebIDL values ↦ implementation-language values, in this case becomes JavaScript values ↦ WebIDL values ↦ JavaScript values. And that intermediate step is where all the logic is performed: a JavaScript `true` becomes a WebIDL `1` in an unsigned long context, which then becomes a JavaScript `1`.
48
+
49
+ ## Don't Use This
50
+
51
+ Seriously, why would you ever use this? You really shouldn't. WebIDL is … not great, and you shouldn't be emulating its semantics. If you're looking for a generic argument-processing library, you should find one with better rules than those from WebIDL. In general, your JavaScript should not be trying to become more like WebIDL; if anything, we should fix WebIDL to make it more like JavaScript.
52
+
53
+ The _only_ people who should use this are those trying to create faithful implementations (or polyfills) of web platform interfaces defined in WebIDL.
@@ -0,0 +1,189 @@
1
+ "use strict";
2
+
3
+ var conversions = {};
4
+ module.exports = conversions;
5
+
6
+ function sign(x) {
7
+ return x < 0 ? -1 : 1;
8
+ }
9
+
10
+ function evenRound(x) {
11
+ // Round x to the nearest integer, choosing the even integer if it lies halfway between two.
12
+ if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor)
13
+ return Math.floor(x);
14
+ } else {
15
+ return Math.round(x);
16
+ }
17
+ }
18
+
19
+ function createNumberConversion(bitLength, typeOpts) {
20
+ if (!typeOpts.unsigned) {
21
+ --bitLength;
22
+ }
23
+ const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength);
24
+ const upperBound = Math.pow(2, bitLength) - 1;
25
+
26
+ const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength);
27
+ const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1);
28
+
29
+ return function(V, opts) {
30
+ if (!opts) opts = {};
31
+
32
+ let x = +V;
33
+
34
+ if (opts.enforceRange) {
35
+ if (!Number.isFinite(x)) {
36
+ throw new TypeError("Argument is not a finite number");
37
+ }
38
+
39
+ x = sign(x) * Math.floor(Math.abs(x));
40
+ if (x < lowerBound || x > upperBound) {
41
+ throw new TypeError("Argument is not in byte range");
42
+ }
43
+
44
+ return x;
45
+ }
46
+
47
+ if (!isNaN(x) && opts.clamp) {
48
+ x = evenRound(x);
49
+
50
+ if (x < lowerBound) x = lowerBound;
51
+ if (x > upperBound) x = upperBound;
52
+ return x;
53
+ }
54
+
55
+ if (!Number.isFinite(x) || x === 0) {
56
+ return 0;
57
+ }
58
+
59
+ x = sign(x) * Math.floor(Math.abs(x));
60
+ x = x % moduloVal;
61
+
62
+ if (!typeOpts.unsigned && x >= moduloBound) {
63
+ return x - moduloVal;
64
+ } else if (typeOpts.unsigned) {
65
+ if (x < 0) {
66
+ x += moduloVal;
67
+ } else if (x === -0) { // don't return negative zero
68
+ return 0;
69
+ }
70
+ }
71
+
72
+ return x;
73
+ }
74
+ }
75
+
76
+ conversions["void"] = function () {
77
+ return undefined;
78
+ };
79
+
80
+ conversions["boolean"] = function (val) {
81
+ return !!val;
82
+ };
83
+
84
+ conversions["byte"] = createNumberConversion(8, { unsigned: false });
85
+ conversions["octet"] = createNumberConversion(8, { unsigned: true });
86
+
87
+ conversions["short"] = createNumberConversion(16, { unsigned: false });
88
+ conversions["unsigned short"] = createNumberConversion(16, { unsigned: true });
89
+
90
+ conversions["long"] = createNumberConversion(32, { unsigned: false });
91
+ conversions["unsigned long"] = createNumberConversion(32, { unsigned: true });
92
+
93
+ conversions["long long"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 });
94
+ conversions["unsigned long long"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 });
95
+
96
+ conversions["double"] = function (V) {
97
+ const x = +V;
98
+
99
+ if (!Number.isFinite(x)) {
100
+ throw new TypeError("Argument is not a finite floating-point value");
101
+ }
102
+
103
+ return x;
104
+ };
105
+
106
+ conversions["unrestricted double"] = function (V) {
107
+ const x = +V;
108
+
109
+ if (isNaN(x)) {
110
+ throw new TypeError("Argument is NaN");
111
+ }
112
+
113
+ return x;
114
+ };
115
+
116
+ // not quite valid, but good enough for JS
117
+ conversions["float"] = conversions["double"];
118
+ conversions["unrestricted float"] = conversions["unrestricted double"];
119
+
120
+ conversions["DOMString"] = function (V, opts) {
121
+ if (!opts) opts = {};
122
+
123
+ if (opts.treatNullAsEmptyString && V === null) {
124
+ return "";
125
+ }
126
+
127
+ return String(V);
128
+ };
129
+
130
+ conversions["ByteString"] = function (V, opts) {
131
+ const x = String(V);
132
+ let c = undefined;
133
+ for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) {
134
+ if (c > 255) {
135
+ throw new TypeError("Argument is not a valid bytestring");
136
+ }
137
+ }
138
+
139
+ return x;
140
+ };
141
+
142
+ conversions["USVString"] = function (V) {
143
+ const S = String(V);
144
+ const n = S.length;
145
+ const U = [];
146
+ for (let i = 0; i < n; ++i) {
147
+ const c = S.charCodeAt(i);
148
+ if (c < 0xD800 || c > 0xDFFF) {
149
+ U.push(String.fromCodePoint(c));
150
+ } else if (0xDC00 <= c && c <= 0xDFFF) {
151
+ U.push(String.fromCodePoint(0xFFFD));
152
+ } else {
153
+ if (i === n - 1) {
154
+ U.push(String.fromCodePoint(0xFFFD));
155
+ } else {
156
+ const d = S.charCodeAt(i + 1);
157
+ if (0xDC00 <= d && d <= 0xDFFF) {
158
+ const a = c & 0x3FF;
159
+ const b = d & 0x3FF;
160
+ U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b));
161
+ ++i;
162
+ } else {
163
+ U.push(String.fromCodePoint(0xFFFD));
164
+ }
165
+ }
166
+ }
167
+ }
168
+
169
+ return U.join('');
170
+ };
171
+
172
+ conversions["Date"] = function (V, opts) {
173
+ if (!(V instanceof Date)) {
174
+ throw new TypeError("Argument is not a Date object");
175
+ }
176
+ if (isNaN(V)) {
177
+ return undefined;
178
+ }
179
+
180
+ return V;
181
+ };
182
+
183
+ conversions["RegExp"] = function (V, opts) {
184
+ if (!(V instanceof RegExp)) {
185
+ V = new RegExp(V);
186
+ }
187
+
188
+ return V;
189
+ };
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "webidl-conversions",
3
+ "version": "3.0.1",
4
+ "description": "Implements the WebIDL algorithms for converting to and from JavaScript values",
5
+ "main": "lib/index.js",
6
+ "scripts": {
7
+ "test": "mocha test/*.js"
8
+ },
9
+ "repository": "jsdom/webidl-conversions",
10
+ "keywords": [
11
+ "webidl",
12
+ "web",
13
+ "types"
14
+ ],
15
+ "files": [
16
+ "lib/"
17
+ ],
18
+ "author": "Domenic Denicola <d@domenic.me> (https://domenic.me/)",
19
+ "license": "BSD-2-Clause",
20
+ "devDependencies": {
21
+ "mocha": "^1.21.4"
22
+ }
23
+ }
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015–2016 Sebastian Mayr
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all 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,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,67 @@
1
+ # whatwg-url
2
+
3
+ whatwg-url is a full implementation of the WHATWG [URL Standard](https://url.spec.whatwg.org/). It can be used standalone, but it also exposes a lot of the internal algorithms that are useful for integrating a URL parser into a project like [jsdom](https://github.com/tmpvar/jsdom).
4
+
5
+ ## Current Status
6
+
7
+ whatwg-url is currently up to date with the URL spec up to commit [a62223](https://github.com/whatwg/url/commit/a622235308342c9adc7fc2fd1659ff059f7d5e2a).
8
+
9
+ ## API
10
+
11
+ ### The `URL` Constructor
12
+
13
+ The main API is the [`URL`](https://url.spec.whatwg.org/#url) export, which follows the spec's behavior in all ways (including e.g. `USVString` conversion). Most consumers of this library will want to use this.
14
+
15
+ ### Low-level URL Standard API
16
+
17
+ The following methods are exported for use by places like jsdom that need to implement things like [`HTMLHyperlinkElementUtils`](https://html.spec.whatwg.org/#htmlhyperlinkelementutils). They operate on or return an "internal URL" or ["URL record"](https://url.spec.whatwg.org/#concept-url) type.
18
+
19
+ - [URL parser](https://url.spec.whatwg.org/#concept-url-parser): `parseURL(input, { baseURL, encodingOverride })`
20
+ - [Basic URL parser](https://url.spec.whatwg.org/#concept-basic-url-parser): `basicURLParse(input, { baseURL, encodingOverride, url, stateOverride })`
21
+ - [URL serializer](https://url.spec.whatwg.org/#concept-url-serializer): `serializeURL(urlRecord, excludeFragment)`
22
+ - [Host serializer](https://url.spec.whatwg.org/#concept-host-serializer): `serializeHost(hostFromURLRecord)`
23
+ - [Serialize an integer](https://url.spec.whatwg.org/#serialize-an-integer): `serializeInteger(number)`
24
+ - [Origin](https://url.spec.whatwg.org/#concept-url-origin) [serializer](https://html.spec.whatwg.org/multipage/browsers.html#serialization-of-an-origin): `serializeURLOrigin(urlRecord)`
25
+ - [Set the username](https://url.spec.whatwg.org/#set-the-username): `setTheUsername(urlRecord, usernameString)`
26
+ - [Set the password](https://url.spec.whatwg.org/#set-the-password): `setThePassword(urlRecord, passwordString)`
27
+ - [Cannot have a username/password/port](https://url.spec.whatwg.org/#cannot-have-a-username-password-port): `cannotHaveAUsernamePasswordPort(urlRecord)`
28
+
29
+ The `stateOverride` parameter is one of the following strings:
30
+
31
+ - [`"scheme start"`](https://url.spec.whatwg.org/#scheme-start-state)
32
+ - [`"scheme"`](https://url.spec.whatwg.org/#scheme-state)
33
+ - [`"no scheme"`](https://url.spec.whatwg.org/#no-scheme-state)
34
+ - [`"special relative or authority"`](https://url.spec.whatwg.org/#special-relative-or-authority-state)
35
+ - [`"path or authority"`](https://url.spec.whatwg.org/#path-or-authority-state)
36
+ - [`"relative"`](https://url.spec.whatwg.org/#relative-state)
37
+ - [`"relative slash"`](https://url.spec.whatwg.org/#relative-slash-state)
38
+ - [`"special authority slashes"`](https://url.spec.whatwg.org/#special-authority-slashes-state)
39
+ - [`"special authority ignore slashes"`](https://url.spec.whatwg.org/#special-authority-ignore-slashes-state)
40
+ - [`"authority"`](https://url.spec.whatwg.org/#authority-state)
41
+ - [`"host"`](https://url.spec.whatwg.org/#host-state)
42
+ - [`"hostname"`](https://url.spec.whatwg.org/#hostname-state)
43
+ - [`"port"`](https://url.spec.whatwg.org/#port-state)
44
+ - [`"file"`](https://url.spec.whatwg.org/#file-state)
45
+ - [`"file slash"`](https://url.spec.whatwg.org/#file-slash-state)
46
+ - [`"file host"`](https://url.spec.whatwg.org/#file-host-state)
47
+ - [`"path start"`](https://url.spec.whatwg.org/#path-start-state)
48
+ - [`"path"`](https://url.spec.whatwg.org/#path-state)
49
+ - [`"cannot-be-a-base-URL path"`](https://url.spec.whatwg.org/#cannot-be-a-base-url-path-state)
50
+ - [`"query"`](https://url.spec.whatwg.org/#query-state)
51
+ - [`"fragment"`](https://url.spec.whatwg.org/#fragment-state)
52
+
53
+ The URL record type has the following API:
54
+
55
+ - [`scheme`](https://url.spec.whatwg.org/#concept-url-scheme)
56
+ - [`username`](https://url.spec.whatwg.org/#concept-url-username)
57
+ - [`password`](https://url.spec.whatwg.org/#concept-url-password)
58
+ - [`host`](https://url.spec.whatwg.org/#concept-url-host)
59
+ - [`port`](https://url.spec.whatwg.org/#concept-url-port)
60
+ - [`path`](https://url.spec.whatwg.org/#concept-url-path) (as an array)
61
+ - [`query`](https://url.spec.whatwg.org/#concept-url-query)
62
+ - [`fragment`](https://url.spec.whatwg.org/#concept-url-fragment)
63
+ - [`cannotBeABaseURL`](https://url.spec.whatwg.org/#url-cannot-be-a-base-url-flag) (as a boolean)
64
+
65
+ These properties should be treated with care, as in general changing them will cause the URL record to be in an inconsistent state until the appropriate invocation of `basicURLParse` is used to fix it up. You can see examples of this in the URL Standard, where there are many step sequences like "4. Set context object’s url’s fragment to the empty string. 5. Basic URL parse _input_ with context object’s url as _url_ and fragment state as _state override_." In between those two steps, a URL record is in an unusable state.
66
+
67
+ The return value of "failure" in the spec is represented by the string `"failure"`. That is, functions like `parseURL` and `basicURLParse` can return _either_ a URL record _or_ the string `"failure"`.
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+ const usm = require("./url-state-machine");
3
+
4
+ exports.implementation = class URLImpl {
5
+ constructor(constructorArgs) {
6
+ const url = constructorArgs[0];
7
+ const base = constructorArgs[1];
8
+
9
+ let parsedBase = null;
10
+ if (base !== undefined) {
11
+ parsedBase = usm.basicURLParse(base);
12
+ if (parsedBase === "failure") {
13
+ throw new TypeError("Invalid base URL");
14
+ }
15
+ }
16
+
17
+ const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase });
18
+ if (parsedURL === "failure") {
19
+ throw new TypeError("Invalid URL");
20
+ }
21
+
22
+ this._url = parsedURL;
23
+
24
+ // TODO: query stuff
25
+ }
26
+
27
+ get href() {
28
+ return usm.serializeURL(this._url);
29
+ }
30
+
31
+ set href(v) {
32
+ const parsedURL = usm.basicURLParse(v);
33
+ if (parsedURL === "failure") {
34
+ throw new TypeError("Invalid URL");
35
+ }
36
+
37
+ this._url = parsedURL;
38
+ }
39
+
40
+ get origin() {
41
+ return usm.serializeURLOrigin(this._url);
42
+ }
43
+
44
+ get protocol() {
45
+ return this._url.scheme + ":";
46
+ }
47
+
48
+ set protocol(v) {
49
+ usm.basicURLParse(v + ":", { url: this._url, stateOverride: "scheme start" });
50
+ }
51
+
52
+ get username() {
53
+ return this._url.username;
54
+ }
55
+
56
+ set username(v) {
57
+ if (usm.cannotHaveAUsernamePasswordPort(this._url)) {
58
+ return;
59
+ }
60
+
61
+ usm.setTheUsername(this._url, v);
62
+ }
63
+
64
+ get password() {
65
+ return this._url.password;
66
+ }
67
+
68
+ set password(v) {
69
+ if (usm.cannotHaveAUsernamePasswordPort(this._url)) {
70
+ return;
71
+ }
72
+
73
+ usm.setThePassword(this._url, v);
74
+ }
75
+
76
+ get host() {
77
+ const url = this._url;
78
+
79
+ if (url.host === null) {
80
+ return "";
81
+ }
82
+
83
+ if (url.port === null) {
84
+ return usm.serializeHost(url.host);
85
+ }
86
+
87
+ return usm.serializeHost(url.host) + ":" + usm.serializeInteger(url.port);
88
+ }
89
+
90
+ set host(v) {
91
+ if (this._url.cannotBeABaseURL) {
92
+ return;
93
+ }
94
+
95
+ usm.basicURLParse(v, { url: this._url, stateOverride: "host" });
96
+ }
97
+
98
+ get hostname() {
99
+ if (this._url.host === null) {
100
+ return "";
101
+ }
102
+
103
+ return usm.serializeHost(this._url.host);
104
+ }
105
+
106
+ set hostname(v) {
107
+ if (this._url.cannotBeABaseURL) {
108
+ return;
109
+ }
110
+
111
+ usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" });
112
+ }
113
+
114
+ get port() {
115
+ if (this._url.port === null) {
116
+ return "";
117
+ }
118
+
119
+ return usm.serializeInteger(this._url.port);
120
+ }
121
+
122
+ set port(v) {
123
+ if (usm.cannotHaveAUsernamePasswordPort(this._url)) {
124
+ return;
125
+ }
126
+
127
+ if (v === "") {
128
+ this._url.port = null;
129
+ } else {
130
+ usm.basicURLParse(v, { url: this._url, stateOverride: "port" });
131
+ }
132
+ }
133
+
134
+ get pathname() {
135
+ if (this._url.cannotBeABaseURL) {
136
+ return this._url.path[0];
137
+ }
138
+
139
+ if (this._url.path.length === 0) {
140
+ return "";
141
+ }
142
+
143
+ return "/" + this._url.path.join("/");
144
+ }
145
+
146
+ set pathname(v) {
147
+ if (this._url.cannotBeABaseURL) {
148
+ return;
149
+ }
150
+
151
+ this._url.path = [];
152
+ usm.basicURLParse(v, { url: this._url, stateOverride: "path start" });
153
+ }
154
+
155
+ get search() {
156
+ if (this._url.query === null || this._url.query === "") {
157
+ return "";
158
+ }
159
+
160
+ return "?" + this._url.query;
161
+ }
162
+
163
+ set search(v) {
164
+ // TODO: query stuff
165
+
166
+ const url = this._url;
167
+
168
+ if (v === "") {
169
+ url.query = null;
170
+ return;
171
+ }
172
+
173
+ const input = v[0] === "?" ? v.substring(1) : v;
174
+ url.query = "";
175
+ usm.basicURLParse(input, { url, stateOverride: "query" });
176
+ }
177
+
178
+ get hash() {
179
+ if (this._url.fragment === null || this._url.fragment === "") {
180
+ return "";
181
+ }
182
+
183
+ return "#" + this._url.fragment;
184
+ }
185
+
186
+ set hash(v) {
187
+ if (v === "") {
188
+ this._url.fragment = null;
189
+ return;
190
+ }
191
+
192
+ const input = v[0] === "#" ? v.substring(1) : v;
193
+ this._url.fragment = "";
194
+ usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" });
195
+ }
196
+
197
+ toJSON() {
198
+ return this.href;
199
+ }
200
+ };