postdoc 0.2.0.beta4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (371) hide show
  1. checksums.yaml +4 -4
  2. data/lib/postdoc/postdoc_view_helper.rb +15 -0
  3. data/lib/postdoc.rb +34 -14
  4. metadata +20 -373
  5. data/lib/pdf.js +0 -27
  6. data/node_modules/agent-base/History.md +0 -113
  7. data/node_modules/agent-base/README.md +0 -145
  8. data/node_modules/agent-base/index.js +0 -160
  9. data/node_modules/agent-base/package.json +0 -35
  10. data/node_modules/agent-base/patch-core.js +0 -37
  11. data/node_modules/agent-base/test/ssl-cert-snakeoil.key +0 -15
  12. data/node_modules/agent-base/test/ssl-cert-snakeoil.pem +0 -12
  13. data/node_modules/agent-base/test/test.js +0 -673
  14. data/node_modules/async-limiter/LICENSE +0 -8
  15. data/node_modules/async-limiter/coverage/coverage.json +0 -1
  16. data/node_modules/async-limiter/coverage/lcov-report/async-throttle/index.html +0 -73
  17. data/node_modules/async-limiter/coverage/lcov-report/async-throttle/index.js.html +0 -246
  18. data/node_modules/async-limiter/coverage/lcov-report/base.css +0 -182
  19. data/node_modules/async-limiter/coverage/lcov-report/index.html +0 -73
  20. data/node_modules/async-limiter/coverage/lcov-report/prettify.css +0 -1
  21. data/node_modules/async-limiter/coverage/lcov-report/prettify.js +0 -1
  22. data/node_modules/async-limiter/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  23. data/node_modules/async-limiter/coverage/lcov-report/sorter.js +0 -156
  24. data/node_modules/async-limiter/coverage/lcov.info +0 -74
  25. data/node_modules/async-limiter/index.js +0 -67
  26. data/node_modules/async-limiter/package.json +0 -35
  27. data/node_modules/async-limiter/readme.md +0 -132
  28. data/node_modules/balanced-match/LICENSE.md +0 -21
  29. data/node_modules/balanced-match/README.md +0 -91
  30. data/node_modules/balanced-match/index.js +0 -59
  31. data/node_modules/balanced-match/package.json +0 -49
  32. data/node_modules/brace-expansion/LICENSE +0 -21
  33. data/node_modules/brace-expansion/README.md +0 -129
  34. data/node_modules/brace-expansion/index.js +0 -201
  35. data/node_modules/brace-expansion/package.json +0 -47
  36. data/node_modules/buffer-from/index.js +0 -69
  37. data/node_modules/buffer-from/package.json +0 -16
  38. data/node_modules/buffer-from/readme.md +0 -69
  39. data/node_modules/buffer-from/test.js +0 -12
  40. data/node_modules/concat-map/LICENSE +0 -18
  41. data/node_modules/concat-map/README.markdown +0 -62
  42. data/node_modules/concat-map/example/map.js +0 -6
  43. data/node_modules/concat-map/index.js +0 -13
  44. data/node_modules/concat-map/package.json +0 -43
  45. data/node_modules/concat-map/test/map.js +0 -39
  46. data/node_modules/concat-stream/LICENSE +0 -24
  47. data/node_modules/concat-stream/index.js +0 -144
  48. data/node_modules/concat-stream/package.json +0 -55
  49. data/node_modules/concat-stream/readme.md +0 -102
  50. data/node_modules/core-util-is/LICENSE +0 -19
  51. data/node_modules/core-util-is/README.md +0 -3
  52. data/node_modules/core-util-is/float.patch +0 -604
  53. data/node_modules/core-util-is/lib/util.js +0 -107
  54. data/node_modules/core-util-is/package.json +0 -32
  55. data/node_modules/core-util-is/test.js +0 -68
  56. data/node_modules/debug/CHANGELOG.md +0 -395
  57. data/node_modules/debug/LICENSE +0 -19
  58. data/node_modules/debug/Makefile +0 -58
  59. data/node_modules/debug/README.md +0 -368
  60. data/node_modules/debug/karma.conf.js +0 -70
  61. data/node_modules/debug/node.js +0 -1
  62. data/node_modules/debug/package.json +0 -43
  63. data/node_modules/debug/src/browser.js +0 -195
  64. data/node_modules/debug/src/debug.js +0 -225
  65. data/node_modules/debug/src/index.js +0 -10
  66. data/node_modules/debug/src/node.js +0 -186
  67. data/node_modules/es6-promise/CHANGELOG.md +0 -151
  68. data/node_modules/es6-promise/LICENSE +0 -19
  69. data/node_modules/es6-promise/README.md +0 -97
  70. data/node_modules/es6-promise/auto.js +0 -4
  71. data/node_modules/es6-promise/dist/es6-promise.auto.js +0 -1181
  72. data/node_modules/es6-promise/dist/es6-promise.auto.map +0 -1
  73. data/node_modules/es6-promise/dist/es6-promise.auto.min.js +0 -1
  74. data/node_modules/es6-promise/dist/es6-promise.auto.min.map +0 -1
  75. data/node_modules/es6-promise/dist/es6-promise.js +0 -1179
  76. data/node_modules/es6-promise/dist/es6-promise.map +0 -1
  77. data/node_modules/es6-promise/dist/es6-promise.min.js +0 -1
  78. data/node_modules/es6-promise/dist/es6-promise.min.map +0 -1
  79. data/node_modules/es6-promise/es6-promise.d.ts +0 -81
  80. data/node_modules/es6-promise/lib/es6-promise/-internal.js +0 -266
  81. data/node_modules/es6-promise/lib/es6-promise/asap.js +0 -119
  82. data/node_modules/es6-promise/lib/es6-promise/enumerator.js +0 -113
  83. data/node_modules/es6-promise/lib/es6-promise/polyfill.js +0 -35
  84. data/node_modules/es6-promise/lib/es6-promise/promise/all.js +0 -52
  85. data/node_modules/es6-promise/lib/es6-promise/promise/race.js +0 -84
  86. data/node_modules/es6-promise/lib/es6-promise/promise/reject.js +0 -46
  87. data/node_modules/es6-promise/lib/es6-promise/promise/resolve.js +0 -48
  88. data/node_modules/es6-promise/lib/es6-promise/promise.js +0 -427
  89. data/node_modules/es6-promise/lib/es6-promise/then.js +0 -32
  90. data/node_modules/es6-promise/lib/es6-promise/utils.js +0 -21
  91. data/node_modules/es6-promise/lib/es6-promise.auto.js +0 -3
  92. data/node_modules/es6-promise/lib/es6-promise.js +0 -7
  93. data/node_modules/es6-promise/package.json +0 -75
  94. data/node_modules/es6-promisify/README.md +0 -89
  95. data/node_modules/es6-promisify/dist/promise.js +0 -73
  96. data/node_modules/es6-promisify/dist/promisify.js +0 -85
  97. data/node_modules/es6-promisify/package.json +0 -41
  98. data/node_modules/extract-zip/CONTRIBUTING.md +0 -1
  99. data/node_modules/extract-zip/LICENSE +0 -23
  100. data/node_modules/extract-zip/cli.js +0 -20
  101. data/node_modules/extract-zip/index.js +0 -205
  102. data/node_modules/extract-zip/node_modules/debug/CHANGELOG.md +0 -362
  103. data/node_modules/extract-zip/node_modules/debug/LICENSE +0 -19
  104. data/node_modules/extract-zip/node_modules/debug/Makefile +0 -50
  105. data/node_modules/extract-zip/node_modules/debug/README.md +0 -312
  106. data/node_modules/extract-zip/node_modules/debug/component.json +0 -19
  107. data/node_modules/extract-zip/node_modules/debug/karma.conf.js +0 -70
  108. data/node_modules/extract-zip/node_modules/debug/node.js +0 -1
  109. data/node_modules/extract-zip/node_modules/debug/package.json +0 -49
  110. data/node_modules/extract-zip/node_modules/debug/src/browser.js +0 -185
  111. data/node_modules/extract-zip/node_modules/debug/src/debug.js +0 -202
  112. data/node_modules/extract-zip/node_modules/debug/src/index.js +0 -10
  113. data/node_modules/extract-zip/node_modules/debug/src/inspector-log.js +0 -15
  114. data/node_modules/extract-zip/node_modules/debug/src/node.js +0 -248
  115. data/node_modules/extract-zip/package.json +0 -35
  116. data/node_modules/extract-zip/readme.md +0 -49
  117. data/node_modules/fd-slicer/CHANGELOG.md +0 -49
  118. data/node_modules/fd-slicer/LICENSE +0 -21
  119. data/node_modules/fd-slicer/README.md +0 -189
  120. data/node_modules/fd-slicer/index.js +0 -277
  121. data/node_modules/fd-slicer/package.json +0 -36
  122. data/node_modules/fd-slicer/test/test.js +0 -350
  123. data/node_modules/fs.realpath/LICENSE +0 -43
  124. data/node_modules/fs.realpath/README.md +0 -33
  125. data/node_modules/fs.realpath/index.js +0 -66
  126. data/node_modules/fs.realpath/old.js +0 -303
  127. data/node_modules/fs.realpath/package.json +0 -26
  128. data/node_modules/glob/LICENSE +0 -15
  129. data/node_modules/glob/README.md +0 -368
  130. data/node_modules/glob/changelog.md +0 -67
  131. data/node_modules/glob/common.js +0 -240
  132. data/node_modules/glob/glob.js +0 -790
  133. data/node_modules/glob/package.json +0 -43
  134. data/node_modules/glob/sync.js +0 -486
  135. data/node_modules/https-proxy-agent/History.md +0 -124
  136. data/node_modules/https-proxy-agent/README.md +0 -137
  137. data/node_modules/https-proxy-agent/index.js +0 -229
  138. data/node_modules/https-proxy-agent/package.json +0 -35
  139. data/node_modules/https-proxy-agent/test/ssl-cert-snakeoil.key +0 -15
  140. data/node_modules/https-proxy-agent/test/ssl-cert-snakeoil.pem +0 -12
  141. data/node_modules/https-proxy-agent/test/test.js +0 -342
  142. data/node_modules/inflight/LICENSE +0 -15
  143. data/node_modules/inflight/README.md +0 -37
  144. data/node_modules/inflight/inflight.js +0 -54
  145. data/node_modules/inflight/package.json +0 -29
  146. data/node_modules/inherits/LICENSE +0 -16
  147. data/node_modules/inherits/README.md +0 -42
  148. data/node_modules/inherits/inherits.js +0 -7
  149. data/node_modules/inherits/inherits_browser.js +0 -23
  150. data/node_modules/inherits/package.json +0 -29
  151. data/node_modules/isarray/Makefile +0 -6
  152. data/node_modules/isarray/README.md +0 -60
  153. data/node_modules/isarray/component.json +0 -19
  154. data/node_modules/isarray/index.js +0 -5
  155. data/node_modules/isarray/package.json +0 -45
  156. data/node_modules/isarray/test.js +0 -20
  157. data/node_modules/mime/CHANGELOG.md +0 -225
  158. data/node_modules/mime/CONTRIBUTING.md +0 -5
  159. data/node_modules/mime/LICENSE +0 -21
  160. data/node_modules/mime/Mime.js +0 -89
  161. data/node_modules/mime/README.md +0 -188
  162. data/node_modules/mime/cli.js +0 -10
  163. data/node_modules/mime/index.js +0 -4
  164. data/node_modules/mime/lite.js +0 -4
  165. data/node_modules/mime/package.json +0 -43
  166. data/node_modules/mime/src/README_js.md +0 -179
  167. data/node_modules/mime/src/build.js +0 -71
  168. data/node_modules/mime/src/test.js +0 -257
  169. data/node_modules/mime/types/other.json +0 -1
  170. data/node_modules/mime/types/standard.json +0 -1
  171. data/node_modules/minimatch/LICENSE +0 -15
  172. data/node_modules/minimatch/README.md +0 -209
  173. data/node_modules/minimatch/minimatch.js +0 -923
  174. data/node_modules/minimatch/package.json +0 -30
  175. data/node_modules/minimist/LICENSE +0 -18
  176. data/node_modules/minimist/example/parse.js +0 -2
  177. data/node_modules/minimist/index.js +0 -187
  178. data/node_modules/minimist/package.json +0 -40
  179. data/node_modules/minimist/readme.markdown +0 -73
  180. data/node_modules/minimist/test/dash.js +0 -24
  181. data/node_modules/minimist/test/default_bool.js +0 -20
  182. data/node_modules/minimist/test/dotted.js +0 -16
  183. data/node_modules/minimist/test/long.js +0 -31
  184. data/node_modules/minimist/test/parse.js +0 -318
  185. data/node_modules/minimist/test/parse_modified.js +0 -9
  186. data/node_modules/minimist/test/short.js +0 -67
  187. data/node_modules/minimist/test/whitespace.js +0 -8
  188. data/node_modules/mkdirp/LICENSE +0 -21
  189. data/node_modules/mkdirp/bin/cmd.js +0 -33
  190. data/node_modules/mkdirp/bin/usage.txt +0 -12
  191. data/node_modules/mkdirp/examples/pow.js +0 -6
  192. data/node_modules/mkdirp/index.js +0 -98
  193. data/node_modules/mkdirp/package.json +0 -27
  194. data/node_modules/mkdirp/readme.markdown +0 -100
  195. data/node_modules/mkdirp/test/chmod.js +0 -41
  196. data/node_modules/mkdirp/test/clobber.js +0 -38
  197. data/node_modules/mkdirp/test/mkdirp.js +0 -28
  198. data/node_modules/mkdirp/test/opts_fs.js +0 -29
  199. data/node_modules/mkdirp/test/opts_fs_sync.js +0 -27
  200. data/node_modules/mkdirp/test/perm.js +0 -32
  201. data/node_modules/mkdirp/test/perm_sync.js +0 -36
  202. data/node_modules/mkdirp/test/race.js +0 -37
  203. data/node_modules/mkdirp/test/rel.js +0 -32
  204. data/node_modules/mkdirp/test/return.js +0 -25
  205. data/node_modules/mkdirp/test/return_sync.js +0 -24
  206. data/node_modules/mkdirp/test/root.js +0 -19
  207. data/node_modules/mkdirp/test/sync.js +0 -32
  208. data/node_modules/mkdirp/test/umask.js +0 -28
  209. data/node_modules/mkdirp/test/umask_sync.js +0 -32
  210. data/node_modules/ms/index.js +0 -152
  211. data/node_modules/ms/license.md +0 -21
  212. data/node_modules/ms/package.json +0 -37
  213. data/node_modules/ms/readme.md +0 -51
  214. data/node_modules/once/LICENSE +0 -15
  215. data/node_modules/once/README.md +0 -79
  216. data/node_modules/once/once.js +0 -42
  217. data/node_modules/once/package.json +0 -33
  218. data/node_modules/path-is-absolute/index.js +0 -20
  219. data/node_modules/path-is-absolute/license +0 -21
  220. data/node_modules/path-is-absolute/package.json +0 -43
  221. data/node_modules/path-is-absolute/readme.md +0 -59
  222. data/node_modules/pend/LICENSE +0 -23
  223. data/node_modules/pend/README.md +0 -41
  224. data/node_modules/pend/index.js +0 -55
  225. data/node_modules/pend/package.json +0 -18
  226. data/node_modules/pend/test.js +0 -137
  227. data/node_modules/process-nextick-args/index.js +0 -44
  228. data/node_modules/process-nextick-args/license.md +0 -19
  229. data/node_modules/process-nextick-args/package.json +0 -25
  230. data/node_modules/process-nextick-args/readme.md +0 -18
  231. data/node_modules/progress/CHANGELOG.md +0 -115
  232. data/node_modules/progress/LICENSE +0 -22
  233. data/node_modules/progress/Makefile +0 -8
  234. data/node_modules/progress/README.md +0 -146
  235. data/node_modules/progress/index.js +0 -1
  236. data/node_modules/progress/lib/node-progress.js +0 -231
  237. data/node_modules/progress/package.json +0 -25
  238. data/node_modules/proxy-from-env/README.md +0 -131
  239. data/node_modules/proxy-from-env/index.js +0 -103
  240. data/node_modules/proxy-from-env/package.json +0 -35
  241. data/node_modules/proxy-from-env/test.js +0 -393
  242. data/node_modules/puppeteer/CONTRIBUTING.md +0 -206
  243. data/node_modules/puppeteer/DeviceDescriptors.js +0 -704
  244. data/node_modules/puppeteer/LICENSE +0 -202
  245. data/node_modules/puppeteer/README.md +0 -306
  246. data/node_modules/puppeteer/index.js +0 -28
  247. data/node_modules/puppeteer/install.js +0 -122
  248. data/node_modules/puppeteer/lib/Browser.js +0 -186
  249. data/node_modules/puppeteer/lib/BrowserFetcher.js +0 -279
  250. data/node_modules/puppeteer/lib/Connection.js +0 -246
  251. data/node_modules/puppeteer/lib/Coverage.js +0 -301
  252. data/node_modules/puppeteer/lib/Dialog.js +0 -84
  253. data/node_modules/puppeteer/lib/ElementHandle.js +0 -328
  254. data/node_modules/puppeteer/lib/EmulationManager.js +0 -89
  255. data/node_modules/puppeteer/lib/ExecutionContext.js +0 -232
  256. data/node_modules/puppeteer/lib/FrameManager.js +0 -997
  257. data/node_modules/puppeteer/lib/Input.js +0 -309
  258. data/node_modules/puppeteer/lib/Launcher.js +0 -310
  259. data/node_modules/puppeteer/lib/Multimap.js +0 -95
  260. data/node_modules/puppeteer/lib/NavigatorWatcher.js +0 -137
  261. data/node_modules/puppeteer/lib/NetworkManager.js +0 -796
  262. data/node_modules/puppeteer/lib/Page.js +0 -1098
  263. data/node_modules/puppeteer/lib/Pipe.js +0 -69
  264. data/node_modules/puppeteer/lib/Puppeteer.js +0 -60
  265. data/node_modules/puppeteer/lib/Target.js +0 -88
  266. data/node_modules/puppeteer/lib/TaskQueue.js +0 -17
  267. data/node_modules/puppeteer/lib/Tracing.js +0 -99
  268. data/node_modules/puppeteer/lib/USKeyboardLayout.js +0 -281
  269. data/node_modules/puppeteer/lib/helper.js +0 -248
  270. data/node_modules/puppeteer/node6/lib/Browser.js +0 -394
  271. data/node_modules/puppeteer/node6/lib/BrowserFetcher.js +0 -357
  272. data/node_modules/puppeteer/node6/lib/Connection.js +0 -350
  273. data/node_modules/puppeteer/node6/lib/Coverage.js +0 -561
  274. data/node_modules/puppeteer/node6/lib/Dialog.js +0 -136
  275. data/node_modules/puppeteer/node6/lib/ElementHandle.js +0 -796
  276. data/node_modules/puppeteer/node6/lib/EmulationManager.js +0 -115
  277. data/node_modules/puppeteer/node6/lib/ExecutionContext.js +0 -414
  278. data/node_modules/puppeteer/node6/lib/FrameManager.js +0 -1621
  279. data/node_modules/puppeteer/node6/lib/Input.js +0 -569
  280. data/node_modules/puppeteer/node6/lib/Launcher.js +0 -362
  281. data/node_modules/puppeteer/node6/lib/Multimap.js +0 -95
  282. data/node_modules/puppeteer/node6/lib/NavigatorWatcher.js +0 -163
  283. data/node_modules/puppeteer/node6/lib/NetworkManager.js +0 -1108
  284. data/node_modules/puppeteer/node6/lib/Page.js +0 -2242
  285. data/node_modules/puppeteer/node6/lib/Pipe.js +0 -69
  286. data/node_modules/puppeteer/node6/lib/Puppeteer.js +0 -60
  287. data/node_modules/puppeteer/node6/lib/Target.js +0 -114
  288. data/node_modules/puppeteer/node6/lib/TaskQueue.js +0 -17
  289. data/node_modules/puppeteer/node6/lib/Tracing.js +0 -177
  290. data/node_modules/puppeteer/node6/lib/USKeyboardLayout.js +0 -281
  291. data/node_modules/puppeteer/node6/lib/helper.js +0 -274
  292. data/node_modules/puppeteer/package.json +0 -61
  293. data/node_modules/readable-stream/CONTRIBUTING.md +0 -38
  294. data/node_modules/readable-stream/GOVERNANCE.md +0 -136
  295. data/node_modules/readable-stream/LICENSE +0 -47
  296. data/node_modules/readable-stream/README.md +0 -58
  297. data/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +0 -60
  298. data/node_modules/readable-stream/duplex-browser.js +0 -1
  299. data/node_modules/readable-stream/duplex.js +0 -1
  300. data/node_modules/readable-stream/lib/_stream_duplex.js +0 -131
  301. data/node_modules/readable-stream/lib/_stream_passthrough.js +0 -47
  302. data/node_modules/readable-stream/lib/_stream_readable.js +0 -1019
  303. data/node_modules/readable-stream/lib/_stream_transform.js +0 -214
  304. data/node_modules/readable-stream/lib/_stream_writable.js +0 -687
  305. data/node_modules/readable-stream/lib/internal/streams/BufferList.js +0 -79
  306. data/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -74
  307. data/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
  308. data/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
  309. data/node_modules/readable-stream/package.json +0 -52
  310. data/node_modules/readable-stream/passthrough.js +0 -1
  311. data/node_modules/readable-stream/readable-browser.js +0 -7
  312. data/node_modules/readable-stream/readable.js +0 -19
  313. data/node_modules/readable-stream/transform.js +0 -1
  314. data/node_modules/readable-stream/writable-browser.js +0 -1
  315. data/node_modules/readable-stream/writable.js +0 -8
  316. data/node_modules/rimraf/LICENSE +0 -15
  317. data/node_modules/rimraf/README.md +0 -101
  318. data/node_modules/rimraf/bin.js +0 -50
  319. data/node_modules/rimraf/package.json +0 -26
  320. data/node_modules/rimraf/rimraf.js +0 -364
  321. data/node_modules/safe-buffer/LICENSE +0 -21
  322. data/node_modules/safe-buffer/README.md +0 -584
  323. data/node_modules/safe-buffer/index.d.ts +0 -187
  324. data/node_modules/safe-buffer/index.js +0 -62
  325. data/node_modules/safe-buffer/package.json +0 -37
  326. data/node_modules/string_decoder/LICENSE +0 -48
  327. data/node_modules/string_decoder/README.md +0 -47
  328. data/node_modules/string_decoder/lib/string_decoder.js +0 -296
  329. data/node_modules/string_decoder/package.json +0 -31
  330. data/node_modules/typedarray/LICENSE +0 -35
  331. data/node_modules/typedarray/example/tarray.js +0 -4
  332. data/node_modules/typedarray/index.js +0 -630
  333. data/node_modules/typedarray/package.json +0 -55
  334. data/node_modules/typedarray/readme.markdown +0 -61
  335. data/node_modules/typedarray/test/server/undef_globals.js +0 -19
  336. data/node_modules/typedarray/test/tarray.js +0 -10
  337. data/node_modules/ultron/LICENSE +0 -22
  338. data/node_modules/ultron/README.md +0 -113
  339. data/node_modules/ultron/index.js +0 -136
  340. data/node_modules/ultron/package.json +0 -41
  341. data/node_modules/util-deprecate/History.md +0 -16
  342. data/node_modules/util-deprecate/LICENSE +0 -24
  343. data/node_modules/util-deprecate/README.md +0 -53
  344. data/node_modules/util-deprecate/browser.js +0 -67
  345. data/node_modules/util-deprecate/node.js +0 -6
  346. data/node_modules/util-deprecate/package.json +0 -27
  347. data/node_modules/wrappy/LICENSE +0 -15
  348. data/node_modules/wrappy/README.md +0 -36
  349. data/node_modules/wrappy/package.json +0 -29
  350. data/node_modules/wrappy/wrappy.js +0 -33
  351. data/node_modules/ws/LICENSE +0 -21
  352. data/node_modules/ws/README.md +0 -341
  353. data/node_modules/ws/index.js +0 -15
  354. data/node_modules/ws/lib/BufferUtil.js +0 -71
  355. data/node_modules/ws/lib/Constants.js +0 -10
  356. data/node_modules/ws/lib/ErrorCodes.js +0 -28
  357. data/node_modules/ws/lib/EventTarget.js +0 -151
  358. data/node_modules/ws/lib/Extensions.js +0 -203
  359. data/node_modules/ws/lib/PerMessageDeflate.js +0 -507
  360. data/node_modules/ws/lib/Receiver.js +0 -553
  361. data/node_modules/ws/lib/Sender.js +0 -412
  362. data/node_modules/ws/lib/Validation.js +0 -17
  363. data/node_modules/ws/lib/WebSocket.js +0 -717
  364. data/node_modules/ws/lib/WebSocketServer.js +0 -326
  365. data/node_modules/ws/package.json +0 -46
  366. data/node_modules/yauzl/LICENSE +0 -21
  367. data/node_modules/yauzl/README.md +0 -467
  368. data/node_modules/yauzl/index.js +0 -626
  369. data/node_modules/yauzl/package.json +0 -36
  370. data/package.json +0 -5
  371. data/yarn.lock +0 -240
@@ -1,187 +0,0 @@
1
- declare module "safe-buffer" {
2
- export class Buffer {
3
- length: number
4
- write(string: string, offset?: number, length?: number, encoding?: string): number;
5
- toString(encoding?: string, start?: number, end?: number): string;
6
- toJSON(): { type: 'Buffer', data: any[] };
7
- equals(otherBuffer: Buffer): boolean;
8
- compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
9
- copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
10
- slice(start?: number, end?: number): Buffer;
11
- writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
12
- writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
13
- writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
14
- writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
15
- readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
16
- readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
17
- readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
18
- readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
19
- readUInt8(offset: number, noAssert?: boolean): number;
20
- readUInt16LE(offset: number, noAssert?: boolean): number;
21
- readUInt16BE(offset: number, noAssert?: boolean): number;
22
- readUInt32LE(offset: number, noAssert?: boolean): number;
23
- readUInt32BE(offset: number, noAssert?: boolean): number;
24
- readInt8(offset: number, noAssert?: boolean): number;
25
- readInt16LE(offset: number, noAssert?: boolean): number;
26
- readInt16BE(offset: number, noAssert?: boolean): number;
27
- readInt32LE(offset: number, noAssert?: boolean): number;
28
- readInt32BE(offset: number, noAssert?: boolean): number;
29
- readFloatLE(offset: number, noAssert?: boolean): number;
30
- readFloatBE(offset: number, noAssert?: boolean): number;
31
- readDoubleLE(offset: number, noAssert?: boolean): number;
32
- readDoubleBE(offset: number, noAssert?: boolean): number;
33
- swap16(): Buffer;
34
- swap32(): Buffer;
35
- swap64(): Buffer;
36
- writeUInt8(value: number, offset: number, noAssert?: boolean): number;
37
- writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
38
- writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
39
- writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
40
- writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
41
- writeInt8(value: number, offset: number, noAssert?: boolean): number;
42
- writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
43
- writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
44
- writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
45
- writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
46
- writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
47
- writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
48
- writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
49
- writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
50
- fill(value: any, offset?: number, end?: number): this;
51
- indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
52
- lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
53
- includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;
54
-
55
- /**
56
- * Allocates a new buffer containing the given {str}.
57
- *
58
- * @param str String to store in buffer.
59
- * @param encoding encoding to use, optional. Default is 'utf8'
60
- */
61
- constructor (str: string, encoding?: string);
62
- /**
63
- * Allocates a new buffer of {size} octets.
64
- *
65
- * @param size count of octets to allocate.
66
- */
67
- constructor (size: number);
68
- /**
69
- * Allocates a new buffer containing the given {array} of octets.
70
- *
71
- * @param array The octets to store.
72
- */
73
- constructor (array: Uint8Array);
74
- /**
75
- * Produces a Buffer backed by the same allocated memory as
76
- * the given {ArrayBuffer}.
77
- *
78
- *
79
- * @param arrayBuffer The ArrayBuffer with which to share memory.
80
- */
81
- constructor (arrayBuffer: ArrayBuffer);
82
- /**
83
- * Allocates a new buffer containing the given {array} of octets.
84
- *
85
- * @param array The octets to store.
86
- */
87
- constructor (array: any[]);
88
- /**
89
- * Copies the passed {buffer} data onto a new {Buffer} instance.
90
- *
91
- * @param buffer The buffer to copy.
92
- */
93
- constructor (buffer: Buffer);
94
- prototype: Buffer;
95
- /**
96
- * Allocates a new Buffer using an {array} of octets.
97
- *
98
- * @param array
99
- */
100
- static from(array: any[]): Buffer;
101
- /**
102
- * When passed a reference to the .buffer property of a TypedArray instance,
103
- * the newly created Buffer will share the same allocated memory as the TypedArray.
104
- * The optional {byteOffset} and {length} arguments specify a memory range
105
- * within the {arrayBuffer} that will be shared by the Buffer.
106
- *
107
- * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
108
- * @param byteOffset
109
- * @param length
110
- */
111
- static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
112
- /**
113
- * Copies the passed {buffer} data onto a new Buffer instance.
114
- *
115
- * @param buffer
116
- */
117
- static from(buffer: Buffer): Buffer;
118
- /**
119
- * Creates a new Buffer containing the given JavaScript string {str}.
120
- * If provided, the {encoding} parameter identifies the character encoding.
121
- * If not provided, {encoding} defaults to 'utf8'.
122
- *
123
- * @param str
124
- */
125
- static from(str: string, encoding?: string): Buffer;
126
- /**
127
- * Returns true if {obj} is a Buffer
128
- *
129
- * @param obj object to test.
130
- */
131
- static isBuffer(obj: any): obj is Buffer;
132
- /**
133
- * Returns true if {encoding} is a valid encoding argument.
134
- * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
135
- *
136
- * @param encoding string to test.
137
- */
138
- static isEncoding(encoding: string): boolean;
139
- /**
140
- * Gives the actual byte length of a string. encoding defaults to 'utf8'.
141
- * This is not the same as String.prototype.length since that returns the number of characters in a string.
142
- *
143
- * @param string string to test.
144
- * @param encoding encoding used to evaluate (defaults to 'utf8')
145
- */
146
- static byteLength(string: string, encoding?: string): number;
147
- /**
148
- * Returns a buffer which is the result of concatenating all the buffers in the list together.
149
- *
150
- * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
151
- * If the list has exactly one item, then the first item of the list is returned.
152
- * If the list has more than one item, then a new Buffer is created.
153
- *
154
- * @param list An array of Buffer objects to concatenate
155
- * @param totalLength Total length of the buffers when concatenated.
156
- * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
157
- */
158
- static concat(list: Buffer[], totalLength?: number): Buffer;
159
- /**
160
- * The same as buf1.compare(buf2).
161
- */
162
- static compare(buf1: Buffer, buf2: Buffer): number;
163
- /**
164
- * Allocates a new buffer of {size} octets.
165
- *
166
- * @param size count of octets to allocate.
167
- * @param fill if specified, buffer will be initialized by calling buf.fill(fill).
168
- * If parameter is omitted, buffer will be filled with zeros.
169
- * @param encoding encoding used for call to buf.fill while initalizing
170
- */
171
- static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
172
- /**
173
- * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
174
- * of the newly created Buffer are unknown and may contain sensitive data.
175
- *
176
- * @param size count of octets to allocate
177
- */
178
- static allocUnsafe(size: number): Buffer;
179
- /**
180
- * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
181
- * of the newly created Buffer are unknown and may contain sensitive data.
182
- *
183
- * @param size count of octets to allocate
184
- */
185
- static allocUnsafeSlow(size: number): Buffer;
186
- }
187
- }
@@ -1,62 +0,0 @@
1
- /* eslint-disable node/no-deprecated-api */
2
- var buffer = require('buffer')
3
- var Buffer = buffer.Buffer
4
-
5
- // alternative to using Object.keys for old browsers
6
- function copyProps (src, dst) {
7
- for (var key in src) {
8
- dst[key] = src[key]
9
- }
10
- }
11
- if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
12
- module.exports = buffer
13
- } else {
14
- // Copy properties from require('buffer')
15
- copyProps(buffer, exports)
16
- exports.Buffer = SafeBuffer
17
- }
18
-
19
- function SafeBuffer (arg, encodingOrOffset, length) {
20
- return Buffer(arg, encodingOrOffset, length)
21
- }
22
-
23
- // Copy static methods from Buffer
24
- copyProps(Buffer, SafeBuffer)
25
-
26
- SafeBuffer.from = function (arg, encodingOrOffset, length) {
27
- if (typeof arg === 'number') {
28
- throw new TypeError('Argument must not be a number')
29
- }
30
- return Buffer(arg, encodingOrOffset, length)
31
- }
32
-
33
- SafeBuffer.alloc = function (size, fill, encoding) {
34
- if (typeof size !== 'number') {
35
- throw new TypeError('Argument must be a number')
36
- }
37
- var buf = Buffer(size)
38
- if (fill !== undefined) {
39
- if (typeof encoding === 'string') {
40
- buf.fill(fill, encoding)
41
- } else {
42
- buf.fill(fill)
43
- }
44
- } else {
45
- buf.fill(0)
46
- }
47
- return buf
48
- }
49
-
50
- SafeBuffer.allocUnsafe = function (size) {
51
- if (typeof size !== 'number') {
52
- throw new TypeError('Argument must be a number')
53
- }
54
- return Buffer(size)
55
- }
56
-
57
- SafeBuffer.allocUnsafeSlow = function (size) {
58
- if (typeof size !== 'number') {
59
- throw new TypeError('Argument must be a number')
60
- }
61
- return buffer.SlowBuffer(size)
62
- }
@@ -1,37 +0,0 @@
1
- {
2
- "name": "safe-buffer",
3
- "description": "Safer Node.js Buffer API",
4
- "version": "5.1.2",
5
- "author": {
6
- "name": "Feross Aboukhadijeh",
7
- "email": "feross@feross.org",
8
- "url": "http://feross.org"
9
- },
10
- "bugs": {
11
- "url": "https://github.com/feross/safe-buffer/issues"
12
- },
13
- "devDependencies": {
14
- "standard": "*",
15
- "tape": "^4.0.0"
16
- },
17
- "homepage": "https://github.com/feross/safe-buffer",
18
- "keywords": [
19
- "buffer",
20
- "buffer allocate",
21
- "node security",
22
- "safe",
23
- "safe-buffer",
24
- "security",
25
- "uninitialized"
26
- ],
27
- "license": "MIT",
28
- "main": "index.js",
29
- "types": "index.d.ts",
30
- "repository": {
31
- "type": "git",
32
- "url": "git://github.com/feross/safe-buffer.git"
33
- },
34
- "scripts": {
35
- "test": "standard && tape test/*.js"
36
- }
37
- }
@@ -1,48 +0,0 @@
1
- Node.js is licensed for use as follows:
2
-
3
- """
4
- Copyright Node.js contributors. All rights reserved.
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining a copy
7
- of this software and associated documentation files (the "Software"), to
8
- deal in the Software without restriction, including without limitation the
9
- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10
- sell copies of the Software, and to permit persons to whom the Software is
11
- furnished to do so, subject to the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be included in
14
- all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22
- IN THE SOFTWARE.
23
- """
24
-
25
- This license applies to parts of Node.js originating from the
26
- https://github.com/joyent/node repository:
27
-
28
- """
29
- Copyright Joyent, Inc. and other Node contributors. All rights reserved.
30
- Permission is hereby granted, free of charge, to any person obtaining a copy
31
- of this software and associated documentation files (the "Software"), to
32
- deal in the Software without restriction, including without limitation the
33
- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
34
- sell copies of the Software, and to permit persons to whom the Software is
35
- furnished to do so, subject to the following conditions:
36
-
37
- The above copyright notice and this permission notice shall be included in
38
- all copies or substantial portions of the Software.
39
-
40
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
41
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
42
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
43
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
44
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
45
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
46
- IN THE SOFTWARE.
47
- """
48
-
@@ -1,47 +0,0 @@
1
- # string_decoder
2
-
3
- ***Node-core v8.9.4 string_decoder for userland***
4
-
5
-
6
- [![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/)
7
- [![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/)
8
-
9
-
10
- ```bash
11
- npm install --save string_decoder
12
- ```
13
-
14
- ***Node-core string_decoder for userland***
15
-
16
- This package is a mirror of the string_decoder implementation in Node-core.
17
-
18
- Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/).
19
-
20
- As of version 1.0.0 **string_decoder** uses semantic versioning.
21
-
22
- ## Previous versions
23
-
24
- Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10.
25
-
26
- ## Update
27
-
28
- The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version.
29
-
30
- ## Streams Working Group
31
-
32
- `string_decoder` is maintained by the Streams Working Group, which
33
- oversees the development and maintenance of the Streams API within
34
- Node.js. The responsibilities of the Streams Working Group include:
35
-
36
- * Addressing stream issues on the Node.js issue tracker.
37
- * Authoring and editing stream documentation within the Node.js project.
38
- * Reviewing changes to stream subclasses within the Node.js project.
39
- * Redirecting changes to streams from the Node.js project to this
40
- project.
41
- * Assisting in the implementation of stream providers within Node.js.
42
- * Recommending versions of `readable-stream` to be included in Node.js.
43
- * Messaging about the future of streams to give the community advance
44
- notice of changes.
45
-
46
- See [readable-stream](https://github.com/nodejs/readable-stream) for
47
- more details.
@@ -1,296 +0,0 @@
1
- // Copyright Joyent, Inc. and other Node contributors.
2
- //
3
- // Permission is hereby granted, free of charge, to any person obtaining a
4
- // copy of this software and associated documentation files (the
5
- // "Software"), to deal in the Software without restriction, including
6
- // without limitation the rights to use, copy, modify, merge, publish,
7
- // distribute, sublicense, and/or sell copies of the Software, and to permit
8
- // persons to whom the Software is furnished to do so, subject to the
9
- // following conditions:
10
- //
11
- // The above copyright notice and this permission notice shall be included
12
- // in all copies or substantial portions of the Software.
13
- //
14
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
21
-
22
- 'use strict';
23
-
24
- /*<replacement>*/
25
-
26
- var Buffer = require('safe-buffer').Buffer;
27
- /*</replacement>*/
28
-
29
- var isEncoding = Buffer.isEncoding || function (encoding) {
30
- encoding = '' + encoding;
31
- switch (encoding && encoding.toLowerCase()) {
32
- case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
33
- return true;
34
- default:
35
- return false;
36
- }
37
- };
38
-
39
- function _normalizeEncoding(enc) {
40
- if (!enc) return 'utf8';
41
- var retried;
42
- while (true) {
43
- switch (enc) {
44
- case 'utf8':
45
- case 'utf-8':
46
- return 'utf8';
47
- case 'ucs2':
48
- case 'ucs-2':
49
- case 'utf16le':
50
- case 'utf-16le':
51
- return 'utf16le';
52
- case 'latin1':
53
- case 'binary':
54
- return 'latin1';
55
- case 'base64':
56
- case 'ascii':
57
- case 'hex':
58
- return enc;
59
- default:
60
- if (retried) return; // undefined
61
- enc = ('' + enc).toLowerCase();
62
- retried = true;
63
- }
64
- }
65
- };
66
-
67
- // Do not cache `Buffer.isEncoding` when checking encoding names as some
68
- // modules monkey-patch it to support additional encodings
69
- function normalizeEncoding(enc) {
70
- var nenc = _normalizeEncoding(enc);
71
- if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
72
- return nenc || enc;
73
- }
74
-
75
- // StringDecoder provides an interface for efficiently splitting a series of
76
- // buffers into a series of JS strings without breaking apart multi-byte
77
- // characters.
78
- exports.StringDecoder = StringDecoder;
79
- function StringDecoder(encoding) {
80
- this.encoding = normalizeEncoding(encoding);
81
- var nb;
82
- switch (this.encoding) {
83
- case 'utf16le':
84
- this.text = utf16Text;
85
- this.end = utf16End;
86
- nb = 4;
87
- break;
88
- case 'utf8':
89
- this.fillLast = utf8FillLast;
90
- nb = 4;
91
- break;
92
- case 'base64':
93
- this.text = base64Text;
94
- this.end = base64End;
95
- nb = 3;
96
- break;
97
- default:
98
- this.write = simpleWrite;
99
- this.end = simpleEnd;
100
- return;
101
- }
102
- this.lastNeed = 0;
103
- this.lastTotal = 0;
104
- this.lastChar = Buffer.allocUnsafe(nb);
105
- }
106
-
107
- StringDecoder.prototype.write = function (buf) {
108
- if (buf.length === 0) return '';
109
- var r;
110
- var i;
111
- if (this.lastNeed) {
112
- r = this.fillLast(buf);
113
- if (r === undefined) return '';
114
- i = this.lastNeed;
115
- this.lastNeed = 0;
116
- } else {
117
- i = 0;
118
- }
119
- if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
120
- return r || '';
121
- };
122
-
123
- StringDecoder.prototype.end = utf8End;
124
-
125
- // Returns only complete characters in a Buffer
126
- StringDecoder.prototype.text = utf8Text;
127
-
128
- // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
129
- StringDecoder.prototype.fillLast = function (buf) {
130
- if (this.lastNeed <= buf.length) {
131
- buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
132
- return this.lastChar.toString(this.encoding, 0, this.lastTotal);
133
- }
134
- buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
135
- this.lastNeed -= buf.length;
136
- };
137
-
138
- // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
139
- // continuation byte. If an invalid byte is detected, -2 is returned.
140
- function utf8CheckByte(byte) {
141
- if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
142
- return byte >> 6 === 0x02 ? -1 : -2;
143
- }
144
-
145
- // Checks at most 3 bytes at the end of a Buffer in order to detect an
146
- // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
147
- // needed to complete the UTF-8 character (if applicable) are returned.
148
- function utf8CheckIncomplete(self, buf, i) {
149
- var j = buf.length - 1;
150
- if (j < i) return 0;
151
- var nb = utf8CheckByte(buf[j]);
152
- if (nb >= 0) {
153
- if (nb > 0) self.lastNeed = nb - 1;
154
- return nb;
155
- }
156
- if (--j < i || nb === -2) return 0;
157
- nb = utf8CheckByte(buf[j]);
158
- if (nb >= 0) {
159
- if (nb > 0) self.lastNeed = nb - 2;
160
- return nb;
161
- }
162
- if (--j < i || nb === -2) return 0;
163
- nb = utf8CheckByte(buf[j]);
164
- if (nb >= 0) {
165
- if (nb > 0) {
166
- if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
167
- }
168
- return nb;
169
- }
170
- return 0;
171
- }
172
-
173
- // Validates as many continuation bytes for a multi-byte UTF-8 character as
174
- // needed or are available. If we see a non-continuation byte where we expect
175
- // one, we "replace" the validated continuation bytes we've seen so far with
176
- // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
177
- // behavior. The continuation byte check is included three times in the case
178
- // where all of the continuation bytes for a character exist in the same buffer.
179
- // It is also done this way as a slight performance increase instead of using a
180
- // loop.
181
- function utf8CheckExtraBytes(self, buf, p) {
182
- if ((buf[0] & 0xC0) !== 0x80) {
183
- self.lastNeed = 0;
184
- return '\ufffd';
185
- }
186
- if (self.lastNeed > 1 && buf.length > 1) {
187
- if ((buf[1] & 0xC0) !== 0x80) {
188
- self.lastNeed = 1;
189
- return '\ufffd';
190
- }
191
- if (self.lastNeed > 2 && buf.length > 2) {
192
- if ((buf[2] & 0xC0) !== 0x80) {
193
- self.lastNeed = 2;
194
- return '\ufffd';
195
- }
196
- }
197
- }
198
- }
199
-
200
- // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
201
- function utf8FillLast(buf) {
202
- var p = this.lastTotal - this.lastNeed;
203
- var r = utf8CheckExtraBytes(this, buf, p);
204
- if (r !== undefined) return r;
205
- if (this.lastNeed <= buf.length) {
206
- buf.copy(this.lastChar, p, 0, this.lastNeed);
207
- return this.lastChar.toString(this.encoding, 0, this.lastTotal);
208
- }
209
- buf.copy(this.lastChar, p, 0, buf.length);
210
- this.lastNeed -= buf.length;
211
- }
212
-
213
- // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
214
- // partial character, the character's bytes are buffered until the required
215
- // number of bytes are available.
216
- function utf8Text(buf, i) {
217
- var total = utf8CheckIncomplete(this, buf, i);
218
- if (!this.lastNeed) return buf.toString('utf8', i);
219
- this.lastTotal = total;
220
- var end = buf.length - (total - this.lastNeed);
221
- buf.copy(this.lastChar, 0, end);
222
- return buf.toString('utf8', i, end);
223
- }
224
-
225
- // For UTF-8, a replacement character is added when ending on a partial
226
- // character.
227
- function utf8End(buf) {
228
- var r = buf && buf.length ? this.write(buf) : '';
229
- if (this.lastNeed) return r + '\ufffd';
230
- return r;
231
- }
232
-
233
- // UTF-16LE typically needs two bytes per character, but even if we have an even
234
- // number of bytes available, we need to check if we end on a leading/high
235
- // surrogate. In that case, we need to wait for the next two bytes in order to
236
- // decode the last character properly.
237
- function utf16Text(buf, i) {
238
- if ((buf.length - i) % 2 === 0) {
239
- var r = buf.toString('utf16le', i);
240
- if (r) {
241
- var c = r.charCodeAt(r.length - 1);
242
- if (c >= 0xD800 && c <= 0xDBFF) {
243
- this.lastNeed = 2;
244
- this.lastTotal = 4;
245
- this.lastChar[0] = buf[buf.length - 2];
246
- this.lastChar[1] = buf[buf.length - 1];
247
- return r.slice(0, -1);
248
- }
249
- }
250
- return r;
251
- }
252
- this.lastNeed = 1;
253
- this.lastTotal = 2;
254
- this.lastChar[0] = buf[buf.length - 1];
255
- return buf.toString('utf16le', i, buf.length - 1);
256
- }
257
-
258
- // For UTF-16LE we do not explicitly append special replacement characters if we
259
- // end on a partial character, we simply let v8 handle that.
260
- function utf16End(buf) {
261
- var r = buf && buf.length ? this.write(buf) : '';
262
- if (this.lastNeed) {
263
- var end = this.lastTotal - this.lastNeed;
264
- return r + this.lastChar.toString('utf16le', 0, end);
265
- }
266
- return r;
267
- }
268
-
269
- function base64Text(buf, i) {
270
- var n = (buf.length - i) % 3;
271
- if (n === 0) return buf.toString('base64', i);
272
- this.lastNeed = 3 - n;
273
- this.lastTotal = 3;
274
- if (n === 1) {
275
- this.lastChar[0] = buf[buf.length - 1];
276
- } else {
277
- this.lastChar[0] = buf[buf.length - 2];
278
- this.lastChar[1] = buf[buf.length - 1];
279
- }
280
- return buf.toString('base64', i, buf.length - n);
281
- }
282
-
283
- function base64End(buf) {
284
- var r = buf && buf.length ? this.write(buf) : '';
285
- if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
286
- return r;
287
- }
288
-
289
- // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
290
- function simpleWrite(buf) {
291
- return buf.toString(this.encoding);
292
- }
293
-
294
- function simpleEnd(buf) {
295
- return buf && buf.length ? this.write(buf) : '';
296
- }