@contrast/agent 4.31.2 → 5.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1796) hide show
  1. package/lib/index.js +56 -0
  2. package/package.json +20 -201
  3. package/LICENSE +0 -12
  4. package/README.md +0 -111
  5. package/agent-loader.js +0 -44
  6. package/bin/VERSION +0 -1
  7. package/bin/contrast-service-darwin-arm64 +0 -0
  8. package/bin/contrast-service-darwin-x64 +0 -0
  9. package/bin/contrast-service-linux-arm64 +0 -0
  10. package/bin/contrast-service-linux-x64 +0 -0
  11. package/bin/contrast-service-win32-x64.exe +0 -0
  12. package/bootstrap.js +0 -65
  13. package/changelog.config.js +0 -56
  14. package/cli-rewriter.js +0 -24
  15. package/cli.js +0 -38
  16. package/config-diagnostics.js +0 -127
  17. package/esm.mjs +0 -156
  18. package/lib/agent-emitter.js +0 -89
  19. package/lib/agent.js +0 -214
  20. package/lib/app-info.js +0 -150
  21. package/lib/assess/deadzones/index.js +0 -93
  22. package/lib/assess/deadzones/rewrite.js +0 -64
  23. package/lib/assess/express/index.js +0 -29
  24. package/lib/assess/express/route-coverage.js +0 -143
  25. package/lib/assess/express/sinks/index.js +0 -23
  26. package/lib/assess/express/sinks/xss.js +0 -88
  27. package/lib/assess/express/sources.js +0 -56
  28. package/lib/assess/fastify/index.js +0 -29
  29. package/lib/assess/fastify/route-coverage.js +0 -119
  30. package/lib/assess/fastify/sinks/index.js +0 -25
  31. package/lib/assess/fastify/sinks/response-scanning.js +0 -54
  32. package/lib/assess/fastify/sinks/unvalidated-redirect.js +0 -95
  33. package/lib/assess/fastify/sinks/xss.js +0 -238
  34. package/lib/assess/fastify/sources.js +0 -76
  35. package/lib/assess/hapi/index.js +0 -29
  36. package/lib/assess/hapi/route-coverage.js +0 -163
  37. package/lib/assess/hapi/sinks/index.js +0 -27
  38. package/lib/assess/hapi/sinks/response-scanning.js +0 -49
  39. package/lib/assess/hapi/sinks/session.js +0 -125
  40. package/lib/assess/hapi/sinks/unvalidated-redirect.js +0 -100
  41. package/lib/assess/hapi/sinks/xss.js +0 -178
  42. package/lib/assess/hapi/sources.js +0 -37
  43. package/lib/assess/index.js +0 -35
  44. package/lib/assess/koa/index.js +0 -29
  45. package/lib/assess/koa/route-coverage.js +0 -114
  46. package/lib/assess/koa/sinks/index.js +0 -25
  47. package/lib/assess/koa/sinks/response-scanning.js +0 -40
  48. package/lib/assess/koa/sinks/unvalidated-redirect.js +0 -96
  49. package/lib/assess/koa/sinks/xss.js +0 -127
  50. package/lib/assess/koa/sources.js +0 -145
  51. package/lib/assess/loopback4/index.js +0 -29
  52. package/lib/assess/loopback4/route-coverage.js +0 -129
  53. package/lib/assess/loopback4/sinks/index.js +0 -25
  54. package/lib/assess/loopback4/sinks/response-scanning.js +0 -39
  55. package/lib/assess/loopback4/sinks/xss.js +0 -77
  56. package/lib/assess/loopback4/sources.js +0 -33
  57. package/lib/assess/membrane/debraner.js +0 -170
  58. package/lib/assess/membrane/deserialization-membrane.js +0 -76
  59. package/lib/assess/membrane/index.js +0 -463
  60. package/lib/assess/membrane/source-membrane.js +0 -415
  61. package/lib/assess/models/base-event.js +0 -207
  62. package/lib/assess/models/call-context.js +0 -197
  63. package/lib/assess/models/index.js +0 -31
  64. package/lib/assess/models/propagation-event.js +0 -77
  65. package/lib/assess/models/signature.js +0 -92
  66. package/lib/assess/models/sink-event.js +0 -43
  67. package/lib/assess/models/source-event.js +0 -95
  68. package/lib/assess/models/tag-range/index.js +0 -180
  69. package/lib/assess/models/tag-range/relationships.js +0 -67
  70. package/lib/assess/models/tag-range/util.js +0 -363
  71. package/lib/assess/policy/deadzones.json +0 -185
  72. package/lib/assess/policy/index.js +0 -20
  73. package/lib/assess/policy/init.js +0 -309
  74. package/lib/assess/policy/non-dataflow-rules.json +0 -156
  75. package/lib/assess/policy/propagators.json +0 -545
  76. package/lib/assess/policy/rules.json +0 -1682
  77. package/lib/assess/policy/signatures.json +0 -1412
  78. package/lib/assess/policy/util.js +0 -423
  79. package/lib/assess/propagators/JSON/parse.js +0 -53
  80. package/lib/assess/propagators/JSON/stringify.js +0 -444
  81. package/lib/assess/propagators/ajv/conditionals.js +0 -164
  82. package/lib/assess/propagators/ajv/evaluator-shim.js +0 -42
  83. package/lib/assess/propagators/ajv/index.js +0 -91
  84. package/lib/assess/propagators/ajv/json-schema-type-evaluators.js +0 -495
  85. package/lib/assess/propagators/ajv/object-walk.js +0 -76
  86. package/lib/assess/propagators/ajv/refs.js +0 -265
  87. package/lib/assess/propagators/ajv/schema-context.js +0 -388
  88. package/lib/assess/propagators/array-prototype-join.js +0 -163
  89. package/lib/assess/propagators/common.js +0 -137
  90. package/lib/assess/propagators/dustjs/escape-html.js +0 -22
  91. package/lib/assess/propagators/dustjs/escape-js.js +0 -22
  92. package/lib/assess/propagators/ejs-template-generate-source.js +0 -64
  93. package/lib/assess/propagators/encode-uri/encode-uri-component.js +0 -22
  94. package/lib/assess/propagators/encode-uri/encode-uri.js +0 -22
  95. package/lib/assess/propagators/fastify-static/allowed-path.js +0 -85
  96. package/lib/assess/propagators/handlebars-compile.js +0 -78
  97. package/lib/assess/propagators/handlebars-escape-expresssion.js +0 -71
  98. package/lib/assess/propagators/index.js +0 -154
  99. package/lib/assess/propagators/joi/any.js +0 -47
  100. package/lib/assess/propagators/joi/boolean.js +0 -68
  101. package/lib/assess/propagators/joi/expression.js +0 -48
  102. package/lib/assess/propagators/joi/index.js +0 -27
  103. package/lib/assess/propagators/joi/keys.js +0 -72
  104. package/lib/assess/propagators/joi/number.js +0 -67
  105. package/lib/assess/propagators/joi/object.js +0 -60
  106. package/lib/assess/propagators/joi/string-base.js +0 -123
  107. package/lib/assess/propagators/joi/string-schema.js +0 -199
  108. package/lib/assess/propagators/joi/values.js +0 -304
  109. package/lib/assess/propagators/manager.js +0 -469
  110. package/lib/assess/propagators/mongoose/helpers.js +0 -57
  111. package/lib/assess/propagators/mongoose/index.js +0 -19
  112. package/lib/assess/propagators/mongoose/map.js +0 -62
  113. package/lib/assess/propagators/mongoose/mixed.js +0 -71
  114. package/lib/assess/propagators/mongoose/string.js +0 -112
  115. package/lib/assess/propagators/mustache/escape.js +0 -22
  116. package/lib/assess/propagators/number.js +0 -54
  117. package/lib/assess/propagators/object.js +0 -60
  118. package/lib/assess/propagators/path/basename.js +0 -113
  119. package/lib/assess/propagators/path/common.js +0 -387
  120. package/lib/assess/propagators/path/dirname.js +0 -78
  121. package/lib/assess/propagators/path/extname.js +0 -83
  122. package/lib/assess/propagators/path/format.js +0 -65
  123. package/lib/assess/propagators/path/join.js +0 -53
  124. package/lib/assess/propagators/path/normalize.js +0 -55
  125. package/lib/assess/propagators/path/parse.js +0 -43
  126. package/lib/assess/propagators/path/relative.js +0 -154
  127. package/lib/assess/propagators/path/resolve.js +0 -63
  128. package/lib/assess/propagators/path/to-namespaced-path.js +0 -52
  129. package/lib/assess/propagators/pug-compile.js +0 -58
  130. package/lib/assess/propagators/querystring/escape.js +0 -56
  131. package/lib/assess/propagators/querystring/parse.js +0 -118
  132. package/lib/assess/propagators/querystring/stringify.js +0 -313
  133. package/lib/assess/propagators/querystring/unescape.js +0 -60
  134. package/lib/assess/propagators/querystring/utils.js +0 -69
  135. package/lib/assess/propagators/sequelize/sql-string-escape.js +0 -61
  136. package/lib/assess/propagators/sequelize/sql-string-format-named-parameters.js +0 -145
  137. package/lib/assess/propagators/sequelize/sql-string-format.js +0 -104
  138. package/lib/assess/propagators/sequelize/utils.js +0 -36
  139. package/lib/assess/propagators/serve-static.js +0 -109
  140. package/lib/assess/propagators/string-prototype-replace.js +0 -671
  141. package/lib/assess/propagators/string-prototype-split.js +0 -266
  142. package/lib/assess/propagators/string-prototype-trim.js +0 -61
  143. package/lib/assess/propagators/string.js +0 -68
  144. package/lib/assess/propagators/template-escape.js +0 -87
  145. package/lib/assess/propagators/templates.js +0 -168
  146. package/lib/assess/propagators/url/url-prototype-parse.js +0 -133
  147. package/lib/assess/propagators/url/url-url.js +0 -464
  148. package/lib/assess/propagators/url/utils.js +0 -58
  149. package/lib/assess/propagators/util/format.js +0 -305
  150. package/lib/assess/propagators/utils.js +0 -148
  151. package/lib/assess/propagators/v8/init-hooks.js +0 -142
  152. package/lib/assess/propagators/validator/init-hooks.js +0 -252
  153. package/lib/assess/propagators/validator/validator-methods.js +0 -98
  154. package/lib/assess/response-scanning/app-activity.js +0 -33
  155. package/lib/assess/response-scanning/autocomplete-missing.js +0 -66
  156. package/lib/assess/response-scanning/cache-controls-missing.js +0 -205
  157. package/lib/assess/response-scanning/clickjacking-control-missing.js +0 -49
  158. package/lib/assess/response-scanning/common.js +0 -58
  159. package/lib/assess/response-scanning/cookies/common.js +0 -63
  160. package/lib/assess/response-scanning/cookies/events.js +0 -28
  161. package/lib/assess/response-scanning/cookies/httponly.js +0 -45
  162. package/lib/assess/response-scanning/cookies/secure-flag-missing.js +0 -46
  163. package/lib/assess/response-scanning/headers/csp-header-insecure.js +0 -190
  164. package/lib/assess/response-scanning/headers/csp-header-missing.js +0 -45
  165. package/lib/assess/response-scanning/headers/csp-utils.js +0 -28
  166. package/lib/assess/response-scanning/headers/hsts-header-missing.js +0 -59
  167. package/lib/assess/response-scanning/headers/powered-by.js +0 -53
  168. package/lib/assess/response-scanning/headers/xcontenttype-header-missing.js +0 -51
  169. package/lib/assess/response-scanning/headers/xxssprotection-header-disabled.js +0 -46
  170. package/lib/assess/response-scanning/parameter-pollution.js +0 -63
  171. package/lib/assess/response-scanning/parseable-response-emitter.js +0 -43
  172. package/lib/assess/restify/index.js +0 -30
  173. package/lib/assess/restify/route-coverage.js +0 -86
  174. package/lib/assess/restify/session.js +0 -53
  175. package/lib/assess/restify/sinks/index.js +0 -25
  176. package/lib/assess/restify/sinks/response-scanning.js +0 -48
  177. package/lib/assess/restify/sinks/unvalidated-redirect.js +0 -100
  178. package/lib/assess/restify/sinks/xss.js +0 -87
  179. package/lib/assess/restify/sources.js +0 -224
  180. package/lib/assess/sinks/common.js +0 -513
  181. package/lib/assess/sinks/dustjs-linkedin-xss.js +0 -131
  182. package/lib/assess/sinks/dynamo.js +0 -277
  183. package/lib/assess/sinks/hapi-16-xss.js +0 -75
  184. package/lib/assess/sinks/index.js +0 -179
  185. package/lib/assess/sinks/libxmljs-xxe.js +0 -57
  186. package/lib/assess/sinks/mongodb.js +0 -368
  187. package/lib/assess/sinks/rethinkdb-nosql-injection.js +0 -142
  188. package/lib/assess/sinks/ssrf-url.js +0 -98
  189. package/lib/assess/sources/event-handler.js +0 -309
  190. package/lib/assess/sources/formidable.js +0 -38
  191. package/lib/assess/sources/index.js +0 -247
  192. package/lib/assess/spdy/index.js +0 -23
  193. package/lib/assess/spdy/sinks/index.js +0 -23
  194. package/lib/assess/spdy/sinks/xss.js +0 -84
  195. package/lib/assess/static/hardcoded.js +0 -345
  196. package/lib/assess/static/read-findings-from-cache.js +0 -40
  197. package/lib/assess/technologies/index.js +0 -48
  198. package/lib/assess/utils.js +0 -22
  199. package/lib/cat.txt +0 -87
  200. package/lib/cli-rewriter/index.js +0 -328
  201. package/lib/constants.js +0 -749
  202. package/lib/contrast.js +0 -465
  203. package/lib/core/arch-components/dynamodb.js +0 -45
  204. package/lib/core/arch-components/dynamodbv3.js +0 -48
  205. package/lib/core/arch-components/index.js +0 -23
  206. package/lib/core/arch-components/mongodb.js +0 -189
  207. package/lib/core/arch-components/mysql.js +0 -63
  208. package/lib/core/arch-components/postgres.js +0 -70
  209. package/lib/core/arch-components/rethinkdb.js +0 -53
  210. package/lib/core/arch-components/sqlite3.js +0 -44
  211. package/lib/core/arch-components/util.js +0 -51
  212. package/lib/core/async-storage/context.js +0 -133
  213. package/lib/core/async-storage/hooks/bluebird.js +0 -91
  214. package/lib/core/async-storage/hooks/mongodb.js +0 -157
  215. package/lib/core/async-storage/hooks/mysql.js +0 -154
  216. package/lib/core/async-storage/hooks/redis.js +0 -38
  217. package/lib/core/async-storage/hooks/utils.js +0 -42
  218. package/lib/core/async-storage/index.js +0 -222
  219. package/lib/core/async-storage/scopes/index.js +0 -153
  220. package/lib/core/common/formidable.js +0 -65
  221. package/lib/core/common/index.js +0 -19
  222. package/lib/core/config/options.js +0 -1015
  223. package/lib/core/config/util.js +0 -391
  224. package/lib/core/exclusions/exclusion-factory.js +0 -124
  225. package/lib/core/exclusions/exclusion.js +0 -48
  226. package/lib/core/exclusions/input.js +0 -95
  227. package/lib/core/exclusions/url.js +0 -66
  228. package/lib/core/express/index.js +0 -538
  229. package/lib/core/express/utils.js +0 -571
  230. package/lib/core/fastify/index.js +0 -199
  231. package/lib/core/fastify/utils.js +0 -28
  232. package/lib/core/hapi/index.js +0 -215
  233. package/lib/core/hapi/utils.js +0 -126
  234. package/lib/core/index.js +0 -34
  235. package/lib/core/koa/index.js +0 -299
  236. package/lib/core/koa/utils.js +0 -31
  237. package/lib/core/logger/daily-rotate-file.js +0 -45
  238. package/lib/core/logger/dataflow-monitor.js +0 -124
  239. package/lib/core/logger/debug-logger.js +0 -364
  240. package/lib/core/logger/index.js +0 -43
  241. package/lib/core/logger/perf-logger.js +0 -241
  242. package/lib/core/logger/umbrella-logger.js +0 -163
  243. package/lib/core/loopback4/index.js +0 -173
  244. package/lib/core/metrics/index.js +0 -150
  245. package/lib/core/restify/index.js +0 -147
  246. package/lib/core/restify/utils.js +0 -84
  247. package/lib/core/rewrite/assignment-expression.js +0 -40
  248. package/lib/core/rewrite/binary-expression.js +0 -63
  249. package/lib/core/rewrite/call-expression.js +0 -44
  250. package/lib/core/rewrite/callees.js +0 -142
  251. package/lib/core/rewrite/catch-clause.js +0 -49
  252. package/lib/core/rewrite/function-wrap.js +0 -49
  253. package/lib/core/rewrite/import-declaration.js +0 -71
  254. package/lib/core/rewrite/index.js +0 -316
  255. package/lib/core/rewrite/injections.js +0 -169
  256. package/lib/core/rewrite/is-contrast-method.js +0 -28
  257. package/lib/core/rewrite/log.js +0 -24
  258. package/lib/core/rewrite/member-expression.js +0 -52
  259. package/lib/core/rewrite/object-property.js +0 -46
  260. package/lib/core/rewrite/prepend-globals.js +0 -48
  261. package/lib/core/rewrite/rewrite-log.js +0 -74
  262. package/lib/core/rewrite/switch-statement.js +0 -71
  263. package/lib/core/rewrite/template-literal.js +0 -64
  264. package/lib/core/stacktrace.js +0 -221
  265. package/lib/coverage.js +0 -158
  266. package/lib/feature-set.js +0 -297
  267. package/lib/generator-function.js +0 -20
  268. package/lib/hooks/array.js +0 -75
  269. package/lib/hooks/cluster.js +0 -232
  270. package/lib/hooks/dataflow-monitor.js +0 -38
  271. package/lib/hooks/encoding.js +0 -88
  272. package/lib/hooks/express-fileupload.js +0 -57
  273. package/lib/hooks/express-session.js +0 -108
  274. package/lib/hooks/fn-to-string.js +0 -106
  275. package/lib/hooks/frameworks/base.js +0 -103
  276. package/lib/hooks/frameworks/common.js +0 -191
  277. package/lib/hooks/frameworks/hapi16.js +0 -293
  278. package/lib/hooks/frameworks/http.js +0 -89
  279. package/lib/hooks/frameworks/http2.js +0 -73
  280. package/lib/hooks/frameworks/index.js +0 -29
  281. package/lib/hooks/frameworks/spdy.js +0 -87
  282. package/lib/hooks/hapi-16-reply.js +0 -55
  283. package/lib/hooks/hapi-16-session.js +0 -312
  284. package/lib/hooks/http.js +0 -210
  285. package/lib/hooks/module/extensions.js +0 -41
  286. package/lib/hooks/module/helpers.js +0 -157
  287. package/lib/hooks/module/index.js +0 -99
  288. package/lib/hooks/newrelic.js +0 -60
  289. package/lib/hooks/object-is.js +0 -48
  290. package/lib/hooks/object-to-primitive.js +0 -64
  291. package/lib/hooks/patcher.js +0 -575
  292. package/lib/hooks/require.js +0 -57
  293. package/lib/hooks/stealthy-require.js +0 -64
  294. package/lib/instrumentation.js +0 -190
  295. package/lib/libraries.js +0 -172
  296. package/lib/library-usage.js +0 -51
  297. package/lib/list-installed.js +0 -97
  298. package/lib/protect/analysis/aho-corasick.js +0 -175
  299. package/lib/protect/analysis/dfsa-analyzer.js +0 -64
  300. package/lib/protect/errors/handler-async-errors.js +0 -66
  301. package/lib/protect/errors/handler.js +0 -55
  302. package/lib/protect/errors/security-exception.js +0 -31
  303. package/lib/protect/express/index.js +0 -27
  304. package/lib/protect/express/sinks.js +0 -34
  305. package/lib/protect/express/sources.js +0 -54
  306. package/lib/protect/express/utils.js +0 -60
  307. package/lib/protect/fastify/index.js +0 -25
  308. package/lib/protect/fastify/sinks.js +0 -37
  309. package/lib/protect/fastify/sources.js +0 -90
  310. package/lib/protect/hapi/error-handler.js +0 -79
  311. package/lib/protect/hapi/index.js +0 -27
  312. package/lib/protect/hapi/sinks.js +0 -40
  313. package/lib/protect/hapi/sources.js +0 -104
  314. package/lib/protect/index.js +0 -31
  315. package/lib/protect/input-analysis.js +0 -359
  316. package/lib/protect/koa/index.js +0 -25
  317. package/lib/protect/koa/sinks.js +0 -38
  318. package/lib/protect/koa/sources.js +0 -152
  319. package/lib/protect/listeners.js +0 -213
  320. package/lib/protect/loopback4/index.js +0 -23
  321. package/lib/protect/loopback4/sources.js +0 -48
  322. package/lib/protect/models/application-context.js +0 -46
  323. package/lib/protect/models/sink-event.js +0 -28
  324. package/lib/protect/models/source-event.js +0 -51
  325. package/lib/protect/restify/index.js +0 -25
  326. package/lib/protect/restify/sinks.js +0 -39
  327. package/lib/protect/restify/sources.js +0 -100
  328. package/lib/protect/rules/assessment.js +0 -204
  329. package/lib/protect/rules/attack-patterns.js +0 -364
  330. package/lib/protect/rules/base-scanner/index.js +0 -621
  331. package/lib/protect/rules/base-scanner/java-script-scanner.js +0 -154
  332. package/lib/protect/rules/base-scanner/postgresqlscanner.js +0 -26
  333. package/lib/protect/rules/base-scanner/scan-state.js +0 -243
  334. package/lib/protect/rules/base-scanner/scan-states.json +0 -14
  335. package/lib/protect/rules/base-scanner/substring-finder.js +0 -59
  336. package/lib/protect/rules/base-scanner/token-sequence.js +0 -57
  337. package/lib/protect/rules/bot-blocker/bot-blocker-rule.js +0 -108
  338. package/lib/protect/rules/bot-blocker/bots.json +0 -283
  339. package/lib/protect/rules/bot-blocker/index.js +0 -93
  340. package/lib/protect/rules/cmd-injection/cmdinjection-rule.js +0 -113
  341. package/lib/protect/rules/cmd-injection-command-backdoors/backdoor-detector.js +0 -103
  342. package/lib/protect/rules/cmd-injection-command-backdoors/cmd-injection-command-backdoors-rule.js +0 -90
  343. package/lib/protect/rules/cmd-injection-semantic-chained-commands/chained-command-scanner.js +0 -278
  344. package/lib/protect/rules/cmd-injection-semantic-chained-commands/cmd-injection-semantic-chained-commands-rule.js +0 -117
  345. package/lib/protect/rules/cmd-injection-semantic-dangerous-paths/cmd-injection-semantic-dangerous-paths-rule.js +0 -112
  346. package/lib/protect/rules/cmd-injection-semantic-dangerous-paths/dangerous-paths-scanner.js +0 -210
  347. package/lib/protect/rules/common.js +0 -38
  348. package/lib/protect/rules/index.js +0 -357
  349. package/lib/protect/rules/ip-denylist/ip-denylist-rule.js +0 -106
  350. package/lib/protect/rules/method-tampering/evaluator.js +0 -39
  351. package/lib/protect/rules/method-tampering/method-tampering-rule.js +0 -99
  352. package/lib/protect/rules/nosqli/nosql-injection-rule.js +0 -307
  353. package/lib/protect/rules/nosqli/nosql-scanner/index.js +0 -46
  354. package/lib/protect/rules/nosqli/nosql-scanner/labels.json +0 -73
  355. package/lib/protect/rules/nosqli/nosql-scanner/mongodbscanner.js +0 -85
  356. package/lib/protect/rules/nosqli/nosql-scanner/rethinkdbscanner.js +0 -26
  357. package/lib/protect/rules/path-traversal/path-traversal-rule.js +0 -61
  358. package/lib/protect/rules/rule-factory.js +0 -250
  359. package/lib/protect/rules/signatures/cmd-injection/config.json +0 -8
  360. package/lib/protect/rules/signatures/cmd-injection/custom-searchers/chained-command-searcher.js +0 -117
  361. package/lib/protect/rules/signatures/cmd-injection/custom-searchers/index.js +0 -26
  362. package/lib/protect/rules/signatures/cmd-injection/index.js +0 -30
  363. package/lib/protect/rules/signatures/evaluator.js +0 -187
  364. package/lib/protect/rules/signatures/index.js +0 -83
  365. package/lib/protect/rules/signatures/nosql-injection/config.json +0 -8
  366. package/lib/protect/rules/signatures/nosql-injection/custom-searchers/index.js +0 -28
  367. package/lib/protect/rules/signatures/nosql-injection/custom-searchers/nosql-comment-searcher.js +0 -42
  368. package/lib/protect/rules/signatures/nosql-injection/custom-searchers/simple-or-searcher.js +0 -115
  369. package/lib/protect/rules/signatures/nosql-injection/index.js +0 -30
  370. package/lib/protect/rules/signatures/path-traversal/config.json +0 -8
  371. package/lib/protect/rules/signatures/path-traversal/index.js +0 -30
  372. package/lib/protect/rules/signatures/reflected-xss/config.json +0 -14
  373. package/lib/protect/rules/signatures/reflected-xss/custom-searchers/behavior-url-searcher.js +0 -84
  374. package/lib/protect/rules/signatures/reflected-xss/custom-searchers/custom-searches.json +0 -103
  375. package/lib/protect/rules/signatures/reflected-xss/custom-searchers/function-definition-searcher.js +0 -59
  376. package/lib/protect/rules/signatures/reflected-xss/custom-searchers/immediate-function-searcher.js +0 -105
  377. package/lib/protect/rules/signatures/reflected-xss/custom-searchers/index.js +0 -36
  378. package/lib/protect/rules/signatures/reflected-xss/custom-searchers/link-and-src-target-searcher.js +0 -145
  379. package/lib/protect/rules/signatures/reflected-xss/custom-searchers/location-set-searcher.js +0 -72
  380. package/lib/protect/rules/signatures/reflected-xss/custom-searchers/map-access-searcher.js +0 -102
  381. package/lib/protect/rules/signatures/reflected-xss/custom-searchers/native-function-execution-searcher.js +0 -82
  382. package/lib/protect/rules/signatures/reflected-xss/custom-searchers/no-alnum-searcher.js +0 -50
  383. package/lib/protect/rules/signatures/reflected-xss/custom-searchers/redefined-function-searcher.js +0 -111
  384. package/lib/protect/rules/signatures/reflected-xss/custom-searchers/style-url-injection-searcher.js +0 -65
  385. package/lib/protect/rules/signatures/reflected-xss/custom-searchers/variable-assignment-searcher.js +0 -90
  386. package/lib/protect/rules/signatures/reflected-xss/helpers/function-call.js +0 -83
  387. package/lib/protect/rules/signatures/reflected-xss/index.js +0 -30
  388. package/lib/protect/rules/signatures/signature.js +0 -201
  389. package/lib/protect/rules/signatures/sql-injection/config.json +0 -10
  390. package/lib/protect/rules/signatures/sql-injection/custom-searchers/if-else-drop-searcher.js +0 -49
  391. package/lib/protect/rules/signatures/sql-injection/custom-searchers/index.js +0 -30
  392. package/lib/protect/rules/signatures/sql-injection/custom-searchers/simple-or-searcher.js +0 -124
  393. package/lib/protect/rules/signatures/sql-injection/custom-searchers/sql-comment-searcher.js +0 -73
  394. package/lib/protect/rules/signatures/sql-injection/custom-searchers/time-function-searcher.js +0 -64
  395. package/lib/protect/rules/signatures/sql-injection/custom-searchers/tsql-exec-searcher.js +0 -45
  396. package/lib/protect/rules/signatures/sql-injection/index.js +0 -30
  397. package/lib/protect/rules/signatures/ssjs-injection/config.json +0 -17
  398. package/lib/protect/rules/signatures/ssjs-injection/index.js +0 -30
  399. package/lib/protect/rules/signatures/unsafe-file-upload/config.json +0 -7
  400. package/lib/protect/rules/signatures/unsafe-file-upload/index.js +0 -29
  401. package/lib/protect/rules/signatures/untrusted-deserialization/config.json +0 -8
  402. package/lib/protect/rules/signatures/untrusted-deserialization/index.js +0 -27
  403. package/lib/protect/rules/sqli/generic-complicated.js +0 -50
  404. package/lib/protect/rules/sqli/sql-injection-rule.js +0 -278
  405. package/lib/protect/rules/sqli/sql-scanner/index.js +0 -61
  406. package/lib/protect/rules/sqli/sql-scanner/labels.json +0 -135
  407. package/lib/protect/rules/sqli/sql-scanner/mysql-scanner.js +0 -170
  408. package/lib/protect/rules/ssjs-injection/evaluator.js +0 -48
  409. package/lib/protect/rules/ssjs-injection/ssjsinjection-rule.js +0 -164
  410. package/lib/protect/rules/unsafe-file-upload/unsafe-file-upload-rule.js +0 -33
  411. package/lib/protect/rules/untrusted-deserialization/untrusted-deserialization-rule.js +0 -95
  412. package/lib/protect/rules/virtual-patch/index.js +0 -17
  413. package/lib/protect/rules/virtual-patch/utils.js +0 -72
  414. package/lib/protect/rules/virtual-patch/virtual-patch-rule.js +0 -162
  415. package/lib/protect/rules/xss/helpers/function-call.js +0 -82
  416. package/lib/protect/rules/xss/reflected-xss-rule.js +0 -103
  417. package/lib/protect/rules/xxe/xxerule.js +0 -184
  418. package/lib/protect/sample-aggregator.js +0 -144
  419. package/lib/protect/samples.js +0 -167
  420. package/lib/protect/service.js +0 -1203
  421. package/lib/protect/sinks/child-process.js +0 -65
  422. package/lib/protect/sinks/eval.js +0 -57
  423. package/lib/protect/sinks/fs.js +0 -97
  424. package/lib/protect/sinks/function.js +0 -64
  425. package/lib/protect/sinks/index.js +0 -54
  426. package/lib/protect/sinks/libxmljs.js +0 -107
  427. package/lib/protect/sinks/mongodb.js +0 -158
  428. package/lib/protect/sinks/mysql.js +0 -63
  429. package/lib/protect/sinks/node-serialize.js +0 -53
  430. package/lib/protect/sinks/postgres.js +0 -81
  431. package/lib/protect/sinks/rethinkdb.js +0 -47
  432. package/lib/protect/sinks/sequelize.js +0 -86
  433. package/lib/protect/sinks/sqlite3.js +0 -50
  434. package/lib/protect/sinks/vm.js +0 -89
  435. package/lib/protect/sources/busboy.js +0 -58
  436. package/lib/protect/sources/formidable.js +0 -55
  437. package/lib/protect/sources/index.js +0 -27
  438. package/lib/protect/validators/authorization.js +0 -31
  439. package/lib/protect/validators/common.js +0 -74
  440. package/lib/protect/validators/connection.js +0 -31
  441. package/lib/protect/validators/content-length.js +0 -30
  442. package/lib/protect/validators/host.js +0 -23
  443. package/lib/protect/validators/if-none-match.js +0 -71
  444. package/lib/protect/validators/index.js +0 -24
  445. package/lib/protect/validators/origin.js +0 -29
  446. package/lib/reporter/app-activity-queue.js +0 -179
  447. package/lib/reporter/grpc-client.js +0 -88
  448. package/lib/reporter/messages/speedracer/activity.js +0 -38
  449. package/lib/reporter/messages/speedracer/application-create.js +0 -65
  450. package/lib/reporter/messages/speedracer/application-update.js +0 -41
  451. package/lib/reporter/messages/speedracer/base.js +0 -401
  452. package/lib/reporter/messages/speedracer/index.js +0 -33
  453. package/lib/reporter/messages/speedracer/observed-route.js +0 -41
  454. package/lib/reporter/messages/speedracer/poll.js +0 -43
  455. package/lib/reporter/messages/speedracer/request.js +0 -33
  456. package/lib/reporter/messages/speedracer/startup.js +0 -63
  457. package/lib/reporter/messaging-router.js +0 -116
  458. package/lib/reporter/models/app-activity/app-activity.js +0 -43
  459. package/lib/reporter/models/app-activity/attacker-activity.js +0 -77
  460. package/lib/reporter/models/app-activity/defend.js +0 -94
  461. package/lib/reporter/models/app-activity/inventory.js +0 -73
  462. package/lib/reporter/models/app-activity/protection-rule-activity.js +0 -68
  463. package/lib/reporter/models/app-activity/rule-events.js +0 -55
  464. package/lib/reporter/models/app-activity/sample.js +0 -139
  465. package/lib/reporter/models/app-activity/source.js +0 -79
  466. package/lib/reporter/models/app-activity/user-input.js +0 -87
  467. package/lib/reporter/models/app-create.js +0 -63
  468. package/lib/reporter/models/app-update/index.js +0 -178
  469. package/lib/reporter/models/app-update/library-manifest.js +0 -54
  470. package/lib/reporter/models/app-update/library-usage.js +0 -36
  471. package/lib/reporter/models/app-update/library.js +0 -165
  472. package/lib/reporter/models/event-tag.js +0 -36
  473. package/lib/reporter/models/finding/event.js +0 -158
  474. package/lib/reporter/models/finding/finding.js +0 -77
  475. package/lib/reporter/models/frameworks/express-request.js +0 -75
  476. package/lib/reporter/models/frameworks/fastify-request.js +0 -27
  477. package/lib/reporter/models/frameworks/hapi-request.js +0 -39
  478. package/lib/reporter/models/frameworks/index.js +0 -21
  479. package/lib/reporter/models/frameworks/koa-request.js +0 -27
  480. package/lib/reporter/models/frameworks/restify-request.js +0 -27
  481. package/lib/reporter/models/observed-route.js +0 -37
  482. package/lib/reporter/models/request.js +0 -288
  483. package/lib/reporter/models/route-coverage.js +0 -53
  484. package/lib/reporter/models/startup.js +0 -56
  485. package/lib/reporter/models/trace-event-source.js +0 -38
  486. package/lib/reporter/models/utils/request-factory.js +0 -32
  487. package/lib/reporter/models/utils/user-input-factory.js +0 -190
  488. package/lib/reporter/models/utils/user-input-kit.js +0 -48
  489. package/lib/reporter/mq-client.js +0 -59
  490. package/lib/reporter/server-activity-queue.js +0 -37
  491. package/lib/reporter/socket-client.js +0 -172
  492. package/lib/reporter/speedracer/base-connection-state.js +0 -49
  493. package/lib/reporter/speedracer/constants.js +0 -68
  494. package/lib/reporter/speedracer/failure-connection-state.js +0 -45
  495. package/lib/reporter/speedracer/index.js +0 -330
  496. package/lib/reporter/speedracer/success-connection-state.js +0 -67
  497. package/lib/reporter/speedracer/unknown-connection-state.js +0 -154
  498. package/lib/reporter/translations/enums.js +0 -268
  499. package/lib/reporter/translations/helpers.js +0 -115
  500. package/lib/reporter/translations/to-protobuf/dtm/activity.js +0 -149
  501. package/lib/reporter/translations/to-protobuf/dtm/address.js +0 -25
  502. package/lib/reporter/translations/to-protobuf/dtm/agent-startup.js +0 -40
  503. package/lib/reporter/translations/to-protobuf/dtm/application-create.js +0 -44
  504. package/lib/reporter/translations/to-protobuf/dtm/application-update.js +0 -61
  505. package/lib/reporter/translations/to-protobuf/dtm/architecture-component.js +0 -33
  506. package/lib/reporter/translations/to-protobuf/dtm/attack-result.js +0 -38
  507. package/lib/reporter/translations/to-protobuf/dtm/bot-blocker-details.js +0 -23
  508. package/lib/reporter/translations/to-protobuf/dtm/cmd-injection-details.js +0 -22
  509. package/lib/reporter/translations/to-protobuf/dtm/cmd-injection-semantic-analysis-details.js +0 -23
  510. package/lib/reporter/translations/to-protobuf/dtm/finding.js +0 -47
  511. package/lib/reporter/translations/to-protobuf/dtm/http-method-tampering-details.js +0 -24
  512. package/lib/reporter/translations/to-protobuf/dtm/http-request.js +0 -50
  513. package/lib/reporter/translations/to-protobuf/dtm/index.js +0 -48
  514. package/lib/reporter/translations/to-protobuf/dtm/ip-denylist-details.js +0 -23
  515. package/lib/reporter/translations/to-protobuf/dtm/library-usage-update.js +0 -32
  516. package/lib/reporter/translations/to-protobuf/dtm/no-sql-injection-details.js +0 -26
  517. package/lib/reporter/translations/to-protobuf/dtm/observed-route.js +0 -73
  518. package/lib/reporter/translations/to-protobuf/dtm/pair.js +0 -24
  519. package/lib/reporter/translations/to-protobuf/dtm/path-traversal-details.js +0 -22
  520. package/lib/reporter/translations/to-protobuf/dtm/poll.js +0 -19
  521. package/lib/reporter/translations/to-protobuf/dtm/rasp-rule-sample.js +0 -134
  522. package/lib/reporter/translations/to-protobuf/dtm/raw-request.js +0 -105
  523. package/lib/reporter/translations/to-protobuf/dtm/route-coverage.js +0 -68
  524. package/lib/reporter/translations/to-protobuf/dtm/simple-pair.js +0 -24
  525. package/lib/reporter/translations/to-protobuf/dtm/sql-injection-details.js +0 -26
  526. package/lib/reporter/translations/to-protobuf/dtm/ssjs-injection-details.js +0 -25
  527. package/lib/reporter/translations/to-protobuf/dtm/stack-trace-element.js +0 -30
  528. package/lib/reporter/translations/to-protobuf/dtm/trace-event/action.js +0 -21
  529. package/lib/reporter/translations/to-protobuf/dtm/trace-event/index.js +0 -56
  530. package/lib/reporter/translations/to-protobuf/dtm/trace-event/parent-object-id.js +0 -23
  531. package/lib/reporter/translations/to-protobuf/dtm/trace-event/trace-event-object.js +0 -28
  532. package/lib/reporter/translations/to-protobuf/dtm/trace-event/trace-event-signature.js +0 -37
  533. package/lib/reporter/translations/to-protobuf/dtm/trace-event/trace-event-source.js +0 -24
  534. package/lib/reporter/translations/to-protobuf/dtm/trace-event/trace-stack.js +0 -27
  535. package/lib/reporter/translations/to-protobuf/dtm/trace-event/trace-taint-range.js +0 -24
  536. package/lib/reporter/translations/to-protobuf/dtm/trace-event/type.js +0 -21
  537. package/lib/reporter/translations/to-protobuf/dtm/untrusted-deserialization-details.js +0 -24
  538. package/lib/reporter/translations/to-protobuf/dtm/user-input.js +0 -37
  539. package/lib/reporter/translations/to-protobuf/dtm/virtual-patch-details.js +0 -23
  540. package/lib/reporter/translations/to-protobuf/dtm/xss-details.js +0 -34
  541. package/lib/reporter/translations/to-protobuf/dtm/xxe-details.js +0 -45
  542. package/lib/reporter/translations/to-protobuf/index.js +0 -18
  543. package/lib/reporter/translations/to-protobuf/settings/application-settings.js +0 -76
  544. package/lib/reporter/translations/to-protobuf/settings/assess-features.js +0 -66
  545. package/lib/reporter/translations/to-protobuf/settings/auth.js +0 -25
  546. package/lib/reporter/translations/to-protobuf/settings/bot-blocker.js +0 -27
  547. package/lib/reporter/translations/to-protobuf/settings/custom-rule-feature.js +0 -27
  548. package/lib/reporter/translations/to-protobuf/settings/defend-features.js +0 -74
  549. package/lib/reporter/translations/to-protobuf/settings/exclusions.js +0 -98
  550. package/lib/reporter/translations/to-protobuf/settings/index.js +0 -37
  551. package/lib/reporter/translations/to-protobuf/settings/input-analysis-result.js +0 -22
  552. package/lib/reporter/translations/to-protobuf/settings/inventory-features.js +0 -35
  553. package/lib/reporter/translations/to-protobuf/settings/ip-filter.js +0 -29
  554. package/lib/reporter/translations/to-protobuf/settings/log-enhancer.js +0 -23
  555. package/lib/reporter/translations/to-protobuf/settings/protection-rule.js +0 -45
  556. package/lib/reporter/translations/to-protobuf/settings/reaction.js +0 -29
  557. package/lib/reporter/translations/to-protobuf/settings/rule-definition.js +0 -59
  558. package/lib/reporter/translations/to-protobuf/settings/sampling.js +0 -35
  559. package/lib/reporter/translations/to-protobuf/settings/server-features.js +0 -73
  560. package/lib/reporter/translations/to-protobuf/settings/syslog.js +0 -62
  561. package/lib/reporter/translations/to-protobuf/settings/virtual-patch.js +0 -77
  562. package/lib/reporter/ts-reporter.js +0 -448
  563. package/lib/telemetry.js +0 -194
  564. package/lib/tracker.js +0 -156
  565. package/lib/util/base64.js +0 -23
  566. package/lib/util/bitset.js +0 -85
  567. package/lib/util/block-request.js +0 -34
  568. package/lib/util/callback-resolver.js +0 -37
  569. package/lib/util/clean-stack.js +0 -308
  570. package/lib/util/clean-string/brackets.js +0 -86
  571. package/lib/util/clean-string/clean-string-base.js +0 -60
  572. package/lib/util/clean-string/comments.js +0 -107
  573. package/lib/util/clean-string/concatenations.js +0 -183
  574. package/lib/util/clean-string/jsclean-string.js +0 -96
  575. package/lib/util/clean-string/placeholders.js +0 -107
  576. package/lib/util/clean-string/util.js +0 -69
  577. package/lib/util/colors.js +0 -28
  578. package/lib/util/config-diagnostics-utils.js +0 -229
  579. package/lib/util/file-finder.js +0 -160
  580. package/lib/util/get-file-type.js +0 -43
  581. package/lib/util/heap-dump.js +0 -72
  582. package/lib/util/html-util.js +0 -83
  583. package/lib/util/ip-analyzer.js +0 -246
  584. package/lib/util/is-agent-path.js +0 -25
  585. package/lib/util/is-contrast-error.js +0 -15
  586. package/lib/util/is-piped-to-dev.js +0 -16
  587. package/lib/util/is-string.js +0 -24
  588. package/lib/util/partial.js +0 -29
  589. package/lib/util/pkg-name.js +0 -23
  590. package/lib/util/request-util.js +0 -74
  591. package/lib/util/resolve-obj.js +0 -39
  592. package/lib/util/route-info.js +0 -50
  593. package/lib/util/some.js +0 -27
  594. package/lib/util/source-map.js +0 -171
  595. package/lib/util/static-rules.js +0 -33
  596. package/lib/util/trace-util.js +0 -74
  597. package/lib/util/traverse.js +0 -188
  598. package/lib/util/user-input-evaluator.js +0 -64
  599. package/lib/util/xml-analyzer/external-entity-finder.js +0 -183
  600. package/node_modules/@colors/colors/LICENSE +0 -26
  601. package/node_modules/@colors/colors/README.md +0 -219
  602. package/node_modules/@colors/colors/examples/normal-usage.js +0 -83
  603. package/node_modules/@colors/colors/examples/safe-string.js +0 -80
  604. package/node_modules/@colors/colors/index.d.ts +0 -136
  605. package/node_modules/@colors/colors/lib/colors.js +0 -211
  606. package/node_modules/@colors/colors/lib/custom/trap.js +0 -46
  607. package/node_modules/@colors/colors/lib/custom/zalgo.js +0 -110
  608. package/node_modules/@colors/colors/lib/extendStringPrototype.js +0 -110
  609. package/node_modules/@colors/colors/lib/index.js +0 -13
  610. package/node_modules/@colors/colors/lib/maps/america.js +0 -10
  611. package/node_modules/@colors/colors/lib/maps/rainbow.js +0 -12
  612. package/node_modules/@colors/colors/lib/maps/random.js +0 -11
  613. package/node_modules/@colors/colors/lib/maps/zebra.js +0 -5
  614. package/node_modules/@colors/colors/lib/styles.js +0 -95
  615. package/node_modules/@colors/colors/lib/system/has-flag.js +0 -35
  616. package/node_modules/@colors/colors/lib/system/supports-colors.js +0 -151
  617. package/node_modules/@colors/colors/package.json +0 -49
  618. package/node_modules/@colors/colors/safe.d.ts +0 -48
  619. package/node_modules/@colors/colors/safe.js +0 -10
  620. package/node_modules/@colors/colors/themes/generic-logging.js +0 -12
  621. package/node_modules/@dabh/diagnostics/CHANGELOG.md +0 -26
  622. package/node_modules/@dabh/diagnostics/LICENSE +0 -20
  623. package/node_modules/@dabh/diagnostics/README.md +0 -473
  624. package/node_modules/@dabh/diagnostics/adapters/hash.js +0 -11
  625. package/node_modules/@dabh/diagnostics/adapters/index.js +0 -18
  626. package/node_modules/@dabh/diagnostics/adapters/localstorage.js +0 -11
  627. package/node_modules/@dabh/diagnostics/adapters/process.env.js +0 -11
  628. package/node_modules/@dabh/diagnostics/browser/development.js +0 -35
  629. package/node_modules/@dabh/diagnostics/browser/index.js +0 -8
  630. package/node_modules/@dabh/diagnostics/browser/override.js +0 -6
  631. package/node_modules/@dabh/diagnostics/browser/production.js +0 -24
  632. package/node_modules/@dabh/diagnostics/diagnostics.js +0 -212
  633. package/node_modules/@dabh/diagnostics/logger/console.js +0 -19
  634. package/node_modules/@dabh/diagnostics/modifiers/namespace-ansi.js +0 -20
  635. package/node_modules/@dabh/diagnostics/modifiers/namespace.js +0 -32
  636. package/node_modules/@dabh/diagnostics/node/development.js +0 -36
  637. package/node_modules/@dabh/diagnostics/node/index.js +0 -8
  638. package/node_modules/@dabh/diagnostics/node/override.js +0 -21
  639. package/node_modules/@dabh/diagnostics/node/production.js +0 -24
  640. package/node_modules/@dabh/diagnostics/package.json +0 -68
  641. package/node_modules/async/CHANGELOG.md +0 -344
  642. package/node_modules/async/LICENSE +0 -19
  643. package/node_modules/async/README.md +0 -60
  644. package/node_modules/async/all.js +0 -119
  645. package/node_modules/async/allLimit.js +0 -46
  646. package/node_modules/async/allSeries.js +0 -45
  647. package/node_modules/async/any.js +0 -122
  648. package/node_modules/async/anyLimit.js +0 -47
  649. package/node_modules/async/anySeries.js +0 -46
  650. package/node_modules/async/apply.js +0 -55
  651. package/node_modules/async/applyEach.js +0 -57
  652. package/node_modules/async/applyEachSeries.js +0 -37
  653. package/node_modules/async/asyncify.js +0 -118
  654. package/node_modules/async/auto.js +0 -333
  655. package/node_modules/async/autoInject.js +0 -182
  656. package/node_modules/async/bower.json +0 -17
  657. package/node_modules/async/cargo.js +0 -63
  658. package/node_modules/async/cargoQueue.js +0 -71
  659. package/node_modules/async/compose.js +0 -55
  660. package/node_modules/async/concat.js +0 -115
  661. package/node_modules/async/concatLimit.js +0 -60
  662. package/node_modules/async/concatSeries.js +0 -41
  663. package/node_modules/async/constant.js +0 -55
  664. package/node_modules/async/detect.js +0 -96
  665. package/node_modules/async/detectLimit.js +0 -48
  666. package/node_modules/async/detectSeries.js +0 -47
  667. package/node_modules/async/dir.js +0 -43
  668. package/node_modules/async/dist/async.js +0 -6057
  669. package/node_modules/async/dist/async.min.js +0 -1
  670. package/node_modules/async/dist/async.mjs +0 -5945
  671. package/node_modules/async/doDuring.js +0 -68
  672. package/node_modules/async/doUntil.js +0 -46
  673. package/node_modules/async/doWhilst.js +0 -68
  674. package/node_modules/async/during.js +0 -78
  675. package/node_modules/async/each.js +0 -129
  676. package/node_modules/async/eachLimit.js +0 -50
  677. package/node_modules/async/eachOf.js +0 -185
  678. package/node_modules/async/eachOfLimit.js +0 -47
  679. package/node_modules/async/eachOfSeries.js +0 -39
  680. package/node_modules/async/eachSeries.js +0 -44
  681. package/node_modules/async/ensureAsync.js +0 -67
  682. package/node_modules/async/every.js +0 -119
  683. package/node_modules/async/everyLimit.js +0 -46
  684. package/node_modules/async/everySeries.js +0 -45
  685. package/node_modules/async/filter.js +0 -93
  686. package/node_modules/async/filterLimit.js +0 -45
  687. package/node_modules/async/filterSeries.js +0 -43
  688. package/node_modules/async/find.js +0 -96
  689. package/node_modules/async/findLimit.js +0 -48
  690. package/node_modules/async/findSeries.js +0 -47
  691. package/node_modules/async/flatMap.js +0 -115
  692. package/node_modules/async/flatMapLimit.js +0 -60
  693. package/node_modules/async/flatMapSeries.js +0 -41
  694. package/node_modules/async/foldl.js +0 -153
  695. package/node_modules/async/foldr.js +0 -41
  696. package/node_modules/async/forEach.js +0 -129
  697. package/node_modules/async/forEachLimit.js +0 -50
  698. package/node_modules/async/forEachOf.js +0 -185
  699. package/node_modules/async/forEachOfLimit.js +0 -47
  700. package/node_modules/async/forEachOfSeries.js +0 -39
  701. package/node_modules/async/forEachSeries.js +0 -44
  702. package/node_modules/async/forever.js +0 -68
  703. package/node_modules/async/groupBy.js +0 -108
  704. package/node_modules/async/groupByLimit.js +0 -71
  705. package/node_modules/async/groupBySeries.js +0 -36
  706. package/node_modules/async/index.js +0 -588
  707. package/node_modules/async/inject.js +0 -153
  708. package/node_modules/async/internal/DoublyLinkedList.js +0 -92
  709. package/node_modules/async/internal/Heap.js +0 -120
  710. package/node_modules/async/internal/applyEach.js +0 -29
  711. package/node_modules/async/internal/asyncEachOfLimit.js +0 -75
  712. package/node_modules/async/internal/awaitify.js +0 -27
  713. package/node_modules/async/internal/breakLoop.js +0 -10
  714. package/node_modules/async/internal/consoleFunc.js +0 -31
  715. package/node_modules/async/internal/createTester.js +0 -40
  716. package/node_modules/async/internal/eachOfLimit.js +0 -90
  717. package/node_modules/async/internal/filter.js +0 -55
  718. package/node_modules/async/internal/getIterator.js +0 -11
  719. package/node_modules/async/internal/initialParams.js +0 -14
  720. package/node_modules/async/internal/isArrayLike.js +0 -10
  721. package/node_modules/async/internal/iterator.js +0 -57
  722. package/node_modules/async/internal/map.js +0 -30
  723. package/node_modules/async/internal/once.js +0 -17
  724. package/node_modules/async/internal/onlyOnce.js +0 -15
  725. package/node_modules/async/internal/parallel.js +0 -34
  726. package/node_modules/async/internal/promiseCallback.js +0 -23
  727. package/node_modules/async/internal/queue.js +0 -291
  728. package/node_modules/async/internal/range.js +0 -14
  729. package/node_modules/async/internal/reject.js +0 -26
  730. package/node_modules/async/internal/setImmediate.js +0 -34
  731. package/node_modules/async/internal/withoutIndex.js +0 -10
  732. package/node_modules/async/internal/wrapAsync.js +0 -34
  733. package/node_modules/async/log.js +0 -41
  734. package/node_modules/async/map.js +0 -142
  735. package/node_modules/async/mapLimit.js +0 -45
  736. package/node_modules/async/mapSeries.js +0 -44
  737. package/node_modules/async/mapValues.js +0 -152
  738. package/node_modules/async/mapValuesLimit.js +0 -61
  739. package/node_modules/async/mapValuesSeries.js +0 -37
  740. package/node_modules/async/memoize.js +0 -91
  741. package/node_modules/async/nextTick.js +0 -52
  742. package/node_modules/async/package.json +0 -84
  743. package/node_modules/async/parallel.js +0 -180
  744. package/node_modules/async/parallelLimit.js +0 -41
  745. package/node_modules/async/priorityQueue.js +0 -91
  746. package/node_modules/async/queue.js +0 -167
  747. package/node_modules/async/race.js +0 -67
  748. package/node_modules/async/reduce.js +0 -153
  749. package/node_modules/async/reduceRight.js +0 -41
  750. package/node_modules/async/reflect.js +0 -78
  751. package/node_modules/async/reflectAll.js +0 -93
  752. package/node_modules/async/reject.js +0 -87
  753. package/node_modules/async/rejectLimit.js +0 -45
  754. package/node_modules/async/rejectSeries.js +0 -43
  755. package/node_modules/async/retry.js +0 -159
  756. package/node_modules/async/retryable.js +0 -77
  757. package/node_modules/async/select.js +0 -93
  758. package/node_modules/async/selectLimit.js +0 -45
  759. package/node_modules/async/selectSeries.js +0 -43
  760. package/node_modules/async/seq.js +0 -79
  761. package/node_modules/async/series.js +0 -186
  762. package/node_modules/async/setImmediate.js +0 -45
  763. package/node_modules/async/some.js +0 -122
  764. package/node_modules/async/someLimit.js +0 -47
  765. package/node_modules/async/someSeries.js +0 -46
  766. package/node_modules/async/sortBy.js +0 -190
  767. package/node_modules/async/timeout.js +0 -89
  768. package/node_modules/async/times.js +0 -50
  769. package/node_modules/async/timesLimit.js +0 -43
  770. package/node_modules/async/timesSeries.js +0 -32
  771. package/node_modules/async/transform.js +0 -173
  772. package/node_modules/async/tryEach.js +0 -78
  773. package/node_modules/async/unmemoize.js +0 -25
  774. package/node_modules/async/until.js +0 -61
  775. package/node_modules/async/waterfall.js +0 -105
  776. package/node_modules/async/whilst.js +0 -78
  777. package/node_modules/async/wrapSync.js +0 -118
  778. package/node_modules/color/LICENSE +0 -21
  779. package/node_modules/color/README.md +0 -123
  780. package/node_modules/color/index.js +0 -482
  781. package/node_modules/color/package.json +0 -44
  782. package/node_modules/color-convert/CHANGELOG.md +0 -54
  783. package/node_modules/color-convert/LICENSE +0 -21
  784. package/node_modules/color-convert/README.md +0 -68
  785. package/node_modules/color-convert/conversions.js +0 -868
  786. package/node_modules/color-convert/index.js +0 -78
  787. package/node_modules/color-convert/package.json +0 -50
  788. package/node_modules/color-convert/route.js +0 -97
  789. package/node_modules/color-name/.eslintrc.json +0 -43
  790. package/node_modules/color-name/.npmignore +0 -107
  791. package/node_modules/color-name/LICENSE +0 -8
  792. package/node_modules/color-name/README.md +0 -11
  793. package/node_modules/color-name/index.js +0 -152
  794. package/node_modules/color-name/package.json +0 -29
  795. package/node_modules/color-name/test.js +0 -7
  796. package/node_modules/color-string/LICENSE +0 -21
  797. package/node_modules/color-string/README.md +0 -62
  798. package/node_modules/color-string/index.js +0 -242
  799. package/node_modules/color-string/package.json +0 -43
  800. package/node_modules/colors/LICENSE +0 -25
  801. package/node_modules/colors/README.md +0 -221
  802. package/node_modules/colors/examples/normal-usage.js +0 -82
  803. package/node_modules/colors/examples/safe-string.js +0 -79
  804. package/node_modules/colors/index.d.ts +0 -136
  805. package/node_modules/colors/lib/colors.js +0 -211
  806. package/node_modules/colors/lib/custom/trap.js +0 -46
  807. package/node_modules/colors/lib/custom/zalgo.js +0 -110
  808. package/node_modules/colors/lib/extendStringPrototype.js +0 -110
  809. package/node_modules/colors/lib/index.js +0 -13
  810. package/node_modules/colors/lib/maps/america.js +0 -10
  811. package/node_modules/colors/lib/maps/rainbow.js +0 -12
  812. package/node_modules/colors/lib/maps/random.js +0 -11
  813. package/node_modules/colors/lib/maps/zebra.js +0 -5
  814. package/node_modules/colors/lib/styles.js +0 -95
  815. package/node_modules/colors/lib/system/has-flag.js +0 -35
  816. package/node_modules/colors/lib/system/supports-colors.js +0 -151
  817. package/node_modules/colors/package.json +0 -49
  818. package/node_modules/colors/safe.d.ts +0 -48
  819. package/node_modules/colors/safe.js +0 -10
  820. package/node_modules/colors/themes/generic-logging.js +0 -12
  821. package/node_modules/colorspace/LICENSE.md +0 -20
  822. package/node_modules/colorspace/README.md +0 -43
  823. package/node_modules/colorspace/index.js +0 -29
  824. package/node_modules/colorspace/package.json +0 -41
  825. package/node_modules/core-util-is/LICENSE +0 -19
  826. package/node_modules/core-util-is/README.md +0 -3
  827. package/node_modules/core-util-is/float.patch +0 -604
  828. package/node_modules/core-util-is/lib/util.js +0 -107
  829. package/node_modules/core-util-is/package.json +0 -36
  830. package/node_modules/core-util-is/test.js +0 -68
  831. package/node_modules/cycle/README.md +0 -49
  832. package/node_modules/cycle/cycle.js +0 -170
  833. package/node_modules/cycle/package.json +0 -16
  834. package/node_modules/enabled/.travis.yml +0 -9
  835. package/node_modules/enabled/LICENSE +0 -20
  836. package/node_modules/enabled/README.md +0 -68
  837. package/node_modules/enabled/index.js +0 -34
  838. package/node_modules/enabled/package.json +0 -37
  839. package/node_modules/enabled/test.js +0 -39
  840. package/node_modules/fast-safe-stringify/.travis.yml +0 -8
  841. package/node_modules/fast-safe-stringify/CHANGELOG.md +0 -17
  842. package/node_modules/fast-safe-stringify/LICENSE +0 -23
  843. package/node_modules/fast-safe-stringify/benchmark.js +0 -137
  844. package/node_modules/fast-safe-stringify/index.d.ts +0 -8
  845. package/node_modules/fast-safe-stringify/index.js +0 -161
  846. package/node_modules/fast-safe-stringify/package.json +0 -50
  847. package/node_modules/fast-safe-stringify/readme.md +0 -154
  848. package/node_modules/fast-safe-stringify/test-stable.js +0 -311
  849. package/node_modules/fast-safe-stringify/test.js +0 -304
  850. package/node_modules/fecha/LICENSE +0 -22
  851. package/node_modules/fecha/README.md +0 -320
  852. package/node_modules/fecha/dist/fecha.min.js +0 -2
  853. package/node_modules/fecha/dist/fecha.min.js.map +0 -1
  854. package/node_modules/fecha/lib/fecha.d.ts +0 -52
  855. package/node_modules/fecha/lib/fecha.js +0 -403
  856. package/node_modules/fecha/lib/fecha.js.map +0 -1
  857. package/node_modules/fecha/lib/fecha.umd.js +0 -418
  858. package/node_modules/fecha/lib/fecha.umd.js.map +0 -1
  859. package/node_modules/fecha/package.json +0 -59
  860. package/node_modules/fecha/src/fecha.ts +0 -524
  861. package/node_modules/file-stream-rotator/.nvmrc +0 -1
  862. package/node_modules/file-stream-rotator/.travis.yml +0 -5
  863. package/node_modules/file-stream-rotator/FileStreamRotator.js +0 -543
  864. package/node_modules/file-stream-rotator/README.md +0 -133
  865. package/node_modules/file-stream-rotator/index.js +0 -1
  866. package/node_modules/file-stream-rotator/package.json +0 -34
  867. package/node_modules/file-stream-rotator/test.js +0 -208
  868. package/node_modules/file-stream-rotator/tests/every-minute-test.js +0 -68
  869. package/node_modules/file-stream-rotator/tests/every-second-test.js +0 -66
  870. package/node_modules/fn.name/.gitattributes +0 -1
  871. package/node_modules/fn.name/.travis.yml +0 -10
  872. package/node_modules/fn.name/LICENSE +0 -22
  873. package/node_modules/fn.name/README.md +0 -42
  874. package/node_modules/fn.name/index.js +0 -42
  875. package/node_modules/fn.name/package.json +0 -41
  876. package/node_modules/fn.name/test.js +0 -73
  877. package/node_modules/inherits/LICENSE +0 -16
  878. package/node_modules/inherits/README.md +0 -42
  879. package/node_modules/inherits/inherits.js +0 -9
  880. package/node_modules/inherits/inherits_browser.js +0 -27
  881. package/node_modules/inherits/package.json +0 -33
  882. package/node_modules/is-arrayish/LICENSE +0 -21
  883. package/node_modules/is-arrayish/README.md +0 -16
  884. package/node_modules/is-arrayish/index.js +0 -9
  885. package/node_modules/is-arrayish/package.json +0 -49
  886. package/node_modules/is-arrayish/yarn-error.log +0 -1443
  887. package/node_modules/is-stream/index.d.ts +0 -80
  888. package/node_modules/is-stream/index.js +0 -29
  889. package/node_modules/is-stream/license +0 -9
  890. package/node_modules/is-stream/package.json +0 -45
  891. package/node_modules/is-stream/readme.md +0 -57
  892. package/node_modules/isarray/.npmignore +0 -1
  893. package/node_modules/isarray/.travis.yml +0 -4
  894. package/node_modules/isarray/Makefile +0 -6
  895. package/node_modules/isarray/README.md +0 -60
  896. package/node_modules/isarray/component.json +0 -19
  897. package/node_modules/isarray/index.js +0 -5
  898. package/node_modules/isarray/package.json +0 -49
  899. package/node_modules/isarray/test.js +0 -20
  900. package/node_modules/kuler/.travis.yml +0 -5
  901. package/node_modules/kuler/LICENSE +0 -7
  902. package/node_modules/kuler/README.md +0 -40
  903. package/node_modules/kuler/index.js +0 -118
  904. package/node_modules/kuler/package.json +0 -38
  905. package/node_modules/kuler/test.js +0 -23
  906. package/node_modules/logform/.babelrc +0 -3
  907. package/node_modules/logform/.eslintrc +0 -7
  908. package/node_modules/logform/.gitattributes +0 -1
  909. package/node_modules/logform/CHANGELOG.md +0 -256
  910. package/node_modules/logform/LICENSE +0 -21
  911. package/node_modules/logform/README.md +0 -653
  912. package/node_modules/logform/align.js +0 -14
  913. package/node_modules/logform/browser.js +0 -38
  914. package/node_modules/logform/cli.js +0 -52
  915. package/node_modules/logform/colorize.js +0 -122
  916. package/node_modules/logform/combine.js +0 -66
  917. package/node_modules/logform/dist/align.js +0 -15
  918. package/node_modules/logform/dist/browser.js +0 -72
  919. package/node_modules/logform/dist/cli.js +0 -73
  920. package/node_modules/logform/dist/colorize.js +0 -144
  921. package/node_modules/logform/dist/combine.js +0 -71
  922. package/node_modules/logform/dist/errors.js +0 -43
  923. package/node_modules/logform/dist/format.js +0 -91
  924. package/node_modules/logform/dist/index.js +0 -87
  925. package/node_modules/logform/dist/json.js +0 -34
  926. package/node_modules/logform/dist/label.js +0 -20
  927. package/node_modules/logform/dist/levels.js +0 -14
  928. package/node_modules/logform/dist/logstash.js +0 -34
  929. package/node_modules/logform/dist/metadata.js +0 -64
  930. package/node_modules/logform/dist/ms.js +0 -21
  931. package/node_modules/logform/dist/pad-levels.js +0 -127
  932. package/node_modules/logform/dist/pretty-print.js +0 -34
  933. package/node_modules/logform/dist/printf.js +0 -41
  934. package/node_modules/logform/dist/simple.js +0 -37
  935. package/node_modules/logform/dist/splat.js +0 -159
  936. package/node_modules/logform/dist/timestamp.js +0 -32
  937. package/node_modules/logform/dist/uncolorize.js +0 -31
  938. package/node_modules/logform/errors.js +0 -39
  939. package/node_modules/logform/examples/combine.js +0 -14
  940. package/node_modules/logform/examples/filter.js +0 -30
  941. package/node_modules/logform/examples/invalid.js +0 -6
  942. package/node_modules/logform/examples/metadata.js +0 -78
  943. package/node_modules/logform/examples/padLevels.js +0 -39
  944. package/node_modules/logform/examples/volume.js +0 -25
  945. package/node_modules/logform/format.js +0 -52
  946. package/node_modules/logform/index.d.ts +0 -197
  947. package/node_modules/logform/index.js +0 -52
  948. package/node_modules/logform/json.js +0 -30
  949. package/node_modules/logform/label.js +0 -19
  950. package/node_modules/logform/levels.js +0 -12
  951. package/node_modules/logform/logstash.js +0 -29
  952. package/node_modules/logform/metadata.js +0 -61
  953. package/node_modules/logform/ms.js +0 -18
  954. package/node_modules/logform/package.json +0 -53
  955. package/node_modules/logform/pad-levels.js +0 -83
  956. package/node_modules/logform/pretty-print.js +0 -29
  957. package/node_modules/logform/printf.js +0 -26
  958. package/node_modules/logform/simple.js +0 -33
  959. package/node_modules/logform/splat.js +0 -132
  960. package/node_modules/logform/timestamp.js +0 -30
  961. package/node_modules/logform/tsconfig.json +0 -22
  962. package/node_modules/logform/uncolorize.js +0 -27
  963. package/node_modules/moment/CHANGELOG.md +0 -988
  964. package/node_modules/moment/LICENSE +0 -22
  965. package/node_modules/moment/README.md +0 -55
  966. package/node_modules/moment/dist/locale/af.js +0 -71
  967. package/node_modules/moment/dist/locale/ar-dz.js +0 -156
  968. package/node_modules/moment/dist/locale/ar-kw.js +0 -55
  969. package/node_modules/moment/dist/locale/ar-ly.js +0 -171
  970. package/node_modules/moment/dist/locale/ar-ma.js +0 -56
  971. package/node_modules/moment/dist/locale/ar-sa.js +0 -105
  972. package/node_modules/moment/dist/locale/ar-tn.js +0 -55
  973. package/node_modules/moment/dist/locale/ar.js +0 -189
  974. package/node_modules/moment/dist/locale/az.js +0 -102
  975. package/node_modules/moment/dist/locale/be.js +0 -142
  976. package/node_modules/moment/dist/locale/bg.js +0 -87
  977. package/node_modules/moment/dist/locale/bm.js +0 -52
  978. package/node_modules/moment/dist/locale/bn-bd.js +0 -129
  979. package/node_modules/moment/dist/locale/bn.js +0 -119
  980. package/node_modules/moment/dist/locale/bo.js +0 -124
  981. package/node_modules/moment/dist/locale/br.js +0 -168
  982. package/node_modules/moment/dist/locale/bs.js +0 -150
  983. package/node_modules/moment/dist/locale/ca.js +0 -100
  984. package/node_modules/moment/dist/locale/cs.js +0 -180
  985. package/node_modules/moment/dist/locale/cv.js +0 -63
  986. package/node_modules/moment/dist/locale/cy.js +0 -98
  987. package/node_modules/moment/dist/locale/da.js +0 -53
  988. package/node_modules/moment/dist/locale/de-at.js +0 -79
  989. package/node_modules/moment/dist/locale/de-ch.js +0 -78
  990. package/node_modules/moment/dist/locale/de.js +0 -78
  991. package/node_modules/moment/dist/locale/dv.js +0 -90
  992. package/node_modules/moment/dist/locale/el.js +0 -106
  993. package/node_modules/moment/dist/locale/en-au.js +0 -68
  994. package/node_modules/moment/dist/locale/en-ca.js +0 -64
  995. package/node_modules/moment/dist/locale/en-gb.js +0 -68
  996. package/node_modules/moment/dist/locale/en-ie.js +0 -68
  997. package/node_modules/moment/dist/locale/en-il.js +0 -64
  998. package/node_modules/moment/dist/locale/en-in.js +0 -68
  999. package/node_modules/moment/dist/locale/en-nz.js +0 -68
  1000. package/node_modules/moment/dist/locale/en-sg.js +0 -68
  1001. package/node_modules/moment/dist/locale/eo.js +0 -68
  1002. package/node_modules/moment/dist/locale/es-do.js +0 -108
  1003. package/node_modules/moment/dist/locale/es-mx.js +0 -110
  1004. package/node_modules/moment/dist/locale/es-us.js +0 -110
  1005. package/node_modules/moment/dist/locale/es.js +0 -110
  1006. package/node_modules/moment/dist/locale/et.js +0 -78
  1007. package/node_modules/moment/dist/locale/eu.js +0 -65
  1008. package/node_modules/moment/dist/locale/fa.js +0 -113
  1009. package/node_modules/moment/dist/locale/fi.js +0 -124
  1010. package/node_modules/moment/dist/locale/fil.js +0 -58
  1011. package/node_modules/moment/dist/locale/fo.js +0 -57
  1012. package/node_modules/moment/dist/locale/fr-ca.js +0 -70
  1013. package/node_modules/moment/dist/locale/fr-ch.js +0 -74
  1014. package/node_modules/moment/dist/locale/fr.js +0 -108
  1015. package/node_modules/moment/dist/locale/fy.js +0 -75
  1016. package/node_modules/moment/dist/locale/ga.js +0 -95
  1017. package/node_modules/moment/dist/locale/gd.js +0 -95
  1018. package/node_modules/moment/dist/locale/gl.js +0 -75
  1019. package/node_modules/moment/dist/locale/gom-deva.js +0 -126
  1020. package/node_modules/moment/dist/locale/gom-latn.js +0 -124
  1021. package/node_modules/moment/dist/locale/gu.js +0 -122
  1022. package/node_modules/moment/dist/locale/he.js +0 -94
  1023. package/node_modules/moment/dist/locale/hi.js +0 -168
  1024. package/node_modules/moment/dist/locale/hr.js +0 -156
  1025. package/node_modules/moment/dist/locale/hu.js +0 -118
  1026. package/node_modules/moment/dist/locale/hy-am.js +0 -94
  1027. package/node_modules/moment/dist/locale/id.js +0 -76
  1028. package/node_modules/moment/dist/locale/is.js +0 -140
  1029. package/node_modules/moment/dist/locale/it-ch.js +0 -64
  1030. package/node_modules/moment/dist/locale/it.js +0 -106
  1031. package/node_modules/moment/dist/locale/ja.js +0 -148
  1032. package/node_modules/moment/dist/locale/jv.js +0 -76
  1033. package/node_modules/moment/dist/locale/ka.js +0 -92
  1034. package/node_modules/moment/dist/locale/kk.js +0 -82
  1035. package/node_modules/moment/dist/locale/km.js +0 -103
  1036. package/node_modules/moment/dist/locale/kn.js +0 -124
  1037. package/node_modules/moment/dist/locale/ko.js +0 -75
  1038. package/node_modules/moment/dist/locale/ku.js +0 -118
  1039. package/node_modules/moment/dist/locale/ky.js +0 -84
  1040. package/node_modules/moment/dist/locale/lb.js +0 -137
  1041. package/node_modules/moment/dist/locale/lo.js +0 -66
  1042. package/node_modules/moment/dist/locale/lt.js +0 -125
  1043. package/node_modules/moment/dist/locale/lv.js +0 -94
  1044. package/node_modules/moment/dist/locale/me.js +0 -117
  1045. package/node_modules/moment/dist/locale/mi.js +0 -60
  1046. package/node_modules/moment/dist/locale/mk.js +0 -85
  1047. package/node_modules/moment/dist/locale/ml.js +0 -82
  1048. package/node_modules/moment/dist/locale/mn.js +0 -100
  1049. package/node_modules/moment/dist/locale/mr.js +0 -203
  1050. package/node_modules/moment/dist/locale/ms-my.js +0 -76
  1051. package/node_modules/moment/dist/locale/ms.js +0 -75
  1052. package/node_modules/moment/dist/locale/mt.js +0 -56
  1053. package/node_modules/moment/dist/locale/my.js +0 -91
  1054. package/node_modules/moment/dist/locale/nb.js +0 -60
  1055. package/node_modules/moment/dist/locale/ne.js +0 -121
  1056. package/node_modules/moment/dist/locale/nl-be.js +0 -102
  1057. package/node_modules/moment/dist/locale/nl.js +0 -104
  1058. package/node_modules/moment/dist/locale/nn.js +0 -59
  1059. package/node_modules/moment/dist/locale/oc-lnc.js +0 -85
  1060. package/node_modules/moment/dist/locale/pa-in.js +0 -122
  1061. package/node_modules/moment/dist/locale/pl.js +0 -140
  1062. package/node_modules/moment/dist/locale/pt-br.js +0 -58
  1063. package/node_modules/moment/dist/locale/pt.js +0 -63
  1064. package/node_modules/moment/dist/locale/ro.js +0 -76
  1065. package/node_modules/moment/dist/locale/ru.js +0 -213
  1066. package/node_modules/moment/dist/locale/sd.js +0 -81
  1067. package/node_modules/moment/dist/locale/se.js +0 -57
  1068. package/node_modules/moment/dist/locale/si.js +0 -69
  1069. package/node_modules/moment/dist/locale/sk.js +0 -145
  1070. package/node_modules/moment/dist/locale/sl.js +0 -171
  1071. package/node_modules/moment/dist/locale/sq.js +0 -65
  1072. package/node_modules/moment/dist/locale/sr-cyrl.js +0 -127
  1073. package/node_modules/moment/dist/locale/sr.js +0 -129
  1074. package/node_modules/moment/dist/locale/ss.js +0 -84
  1075. package/node_modules/moment/dist/locale/sv.js +0 -68
  1076. package/node_modules/moment/dist/locale/sw.js +0 -55
  1077. package/node_modules/moment/dist/locale/ta.js +0 -131
  1078. package/node_modules/moment/dist/locale/te.js +0 -88
  1079. package/node_modules/moment/dist/locale/tet.js +0 -68
  1080. package/node_modules/moment/dist/locale/tg.js +0 -117
  1081. package/node_modules/moment/dist/locale/th.js +0 -65
  1082. package/node_modules/moment/dist/locale/tk.js +0 -91
  1083. package/node_modules/moment/dist/locale/tl-ph.js +0 -57
  1084. package/node_modules/moment/dist/locale/tlh.js +0 -124
  1085. package/node_modules/moment/dist/locale/tr.js +0 -106
  1086. package/node_modules/moment/dist/locale/tzl.js +0 -89
  1087. package/node_modules/moment/dist/locale/tzm-latn.js +0 -54
  1088. package/node_modules/moment/dist/locale/tzm.js +0 -54
  1089. package/node_modules/moment/dist/locale/ug-cn.js +0 -111
  1090. package/node_modules/moment/dist/locale/uk.js +0 -167
  1091. package/node_modules/moment/dist/locale/ur.js +0 -82
  1092. package/node_modules/moment/dist/locale/uz-latn.js +0 -54
  1093. package/node_modules/moment/dist/locale/uz.js +0 -51
  1094. package/node_modules/moment/dist/locale/vi.js +0 -80
  1095. package/node_modules/moment/dist/locale/x-pseudo.js +0 -73
  1096. package/node_modules/moment/dist/locale/yo.js +0 -53
  1097. package/node_modules/moment/dist/locale/zh-cn.js +0 -120
  1098. package/node_modules/moment/dist/locale/zh-hk.js +0 -101
  1099. package/node_modules/moment/dist/locale/zh-mo.js +0 -100
  1100. package/node_modules/moment/dist/locale/zh-tw.js +0 -99
  1101. package/node_modules/moment/dist/moment.js +0 -5677
  1102. package/node_modules/moment/ender.js +0 -1
  1103. package/node_modules/moment/locale/af.js +0 -82
  1104. package/node_modules/moment/locale/ar-dz.js +0 -167
  1105. package/node_modules/moment/locale/ar-kw.js +0 -66
  1106. package/node_modules/moment/locale/ar-ly.js +0 -182
  1107. package/node_modules/moment/locale/ar-ma.js +0 -67
  1108. package/node_modules/moment/locale/ar-sa.js +0 -116
  1109. package/node_modules/moment/locale/ar-tn.js +0 -66
  1110. package/node_modules/moment/locale/ar.js +0 -200
  1111. package/node_modules/moment/locale/az.js +0 -113
  1112. package/node_modules/moment/locale/be.js +0 -153
  1113. package/node_modules/moment/locale/bg.js +0 -98
  1114. package/node_modules/moment/locale/bm.js +0 -62
  1115. package/node_modules/moment/locale/bn-bd.js +0 -140
  1116. package/node_modules/moment/locale/bn.js +0 -130
  1117. package/node_modules/moment/locale/bo.js +0 -135
  1118. package/node_modules/moment/locale/br.js +0 -179
  1119. package/node_modules/moment/locale/bs.js +0 -161
  1120. package/node_modules/moment/locale/ca.js +0 -111
  1121. package/node_modules/moment/locale/cs.js +0 -191
  1122. package/node_modules/moment/locale/cv.js +0 -74
  1123. package/node_modules/moment/locale/cy.js +0 -109
  1124. package/node_modules/moment/locale/da.js +0 -64
  1125. package/node_modules/moment/locale/de-at.js +0 -90
  1126. package/node_modules/moment/locale/de-ch.js +0 -87
  1127. package/node_modules/moment/locale/de.js +0 -89
  1128. package/node_modules/moment/locale/dv.js +0 -101
  1129. package/node_modules/moment/locale/el.js +0 -117
  1130. package/node_modules/moment/locale/en-au.js +0 -79
  1131. package/node_modules/moment/locale/en-ca.js +0 -75
  1132. package/node_modules/moment/locale/en-gb.js +0 -79
  1133. package/node_modules/moment/locale/en-ie.js +0 -79
  1134. package/node_modules/moment/locale/en-il.js +0 -75
  1135. package/node_modules/moment/locale/en-in.js +0 -79
  1136. package/node_modules/moment/locale/en-nz.js +0 -79
  1137. package/node_modules/moment/locale/en-sg.js +0 -79
  1138. package/node_modules/moment/locale/eo.js +0 -79
  1139. package/node_modules/moment/locale/es-do.js +0 -119
  1140. package/node_modules/moment/locale/es-mx.js +0 -121
  1141. package/node_modules/moment/locale/es-us.js +0 -121
  1142. package/node_modules/moment/locale/es.js +0 -121
  1143. package/node_modules/moment/locale/et.js +0 -89
  1144. package/node_modules/moment/locale/eu.js +0 -76
  1145. package/node_modules/moment/locale/fa.js +0 -124
  1146. package/node_modules/moment/locale/fi.js +0 -135
  1147. package/node_modules/moment/locale/fil.js +0 -69
  1148. package/node_modules/moment/locale/fo.js +0 -68
  1149. package/node_modules/moment/locale/fr-ca.js +0 -81
  1150. package/node_modules/moment/locale/fr-ch.js +0 -85
  1151. package/node_modules/moment/locale/fr.js +0 -119
  1152. package/node_modules/moment/locale/fy.js +0 -86
  1153. package/node_modules/moment/locale/ga.js +0 -106
  1154. package/node_modules/moment/locale/gd.js +0 -106
  1155. package/node_modules/moment/locale/gl.js +0 -86
  1156. package/node_modules/moment/locale/gom-deva.js +0 -137
  1157. package/node_modules/moment/locale/gom-latn.js +0 -135
  1158. package/node_modules/moment/locale/gu.js +0 -133
  1159. package/node_modules/moment/locale/he.js +0 -105
  1160. package/node_modules/moment/locale/hi.js +0 -179
  1161. package/node_modules/moment/locale/hr.js +0 -167
  1162. package/node_modules/moment/locale/hu.js +0 -129
  1163. package/node_modules/moment/locale/hy-am.js +0 -105
  1164. package/node_modules/moment/locale/id.js +0 -87
  1165. package/node_modules/moment/locale/is.js +0 -151
  1166. package/node_modules/moment/locale/it-ch.js +0 -75
  1167. package/node_modules/moment/locale/it.js +0 -117
  1168. package/node_modules/moment/locale/ja.js +0 -159
  1169. package/node_modules/moment/locale/jv.js +0 -87
  1170. package/node_modules/moment/locale/ka.js +0 -103
  1171. package/node_modules/moment/locale/kk.js +0 -93
  1172. package/node_modules/moment/locale/km.js +0 -114
  1173. package/node_modules/moment/locale/kn.js +0 -135
  1174. package/node_modules/moment/locale/ko.js +0 -86
  1175. package/node_modules/moment/locale/ku.js +0 -129
  1176. package/node_modules/moment/locale/ky.js +0 -95
  1177. package/node_modules/moment/locale/lb.js +0 -148
  1178. package/node_modules/moment/locale/lo.js +0 -77
  1179. package/node_modules/moment/locale/lt.js +0 -136
  1180. package/node_modules/moment/locale/lv.js +0 -105
  1181. package/node_modules/moment/locale/me.js +0 -128
  1182. package/node_modules/moment/locale/mi.js +0 -71
  1183. package/node_modules/moment/locale/mk.js +0 -97
  1184. package/node_modules/moment/locale/ml.js +0 -93
  1185. package/node_modules/moment/locale/mn.js +0 -111
  1186. package/node_modules/moment/locale/mr.js +0 -214
  1187. package/node_modules/moment/locale/ms-my.js +0 -87
  1188. package/node_modules/moment/locale/ms.js +0 -86
  1189. package/node_modules/moment/locale/mt.js +0 -67
  1190. package/node_modules/moment/locale/my.js +0 -102
  1191. package/node_modules/moment/locale/nb.js +0 -71
  1192. package/node_modules/moment/locale/ne.js +0 -132
  1193. package/node_modules/moment/locale/nl-be.js +0 -113
  1194. package/node_modules/moment/locale/nl.js +0 -115
  1195. package/node_modules/moment/locale/nn.js +0 -70
  1196. package/node_modules/moment/locale/oc-lnc.js +0 -96
  1197. package/node_modules/moment/locale/pa-in.js +0 -133
  1198. package/node_modules/moment/locale/pl.js +0 -151
  1199. package/node_modules/moment/locale/pt-br.js +0 -69
  1200. package/node_modules/moment/locale/pt.js +0 -74
  1201. package/node_modules/moment/locale/ro.js +0 -87
  1202. package/node_modules/moment/locale/ru.js +0 -224
  1203. package/node_modules/moment/locale/sd.js +0 -92
  1204. package/node_modules/moment/locale/se.js +0 -68
  1205. package/node_modules/moment/locale/si.js +0 -80
  1206. package/node_modules/moment/locale/sk.js +0 -156
  1207. package/node_modules/moment/locale/sl.js +0 -182
  1208. package/node_modules/moment/locale/sq.js +0 -76
  1209. package/node_modules/moment/locale/sr-cyrl.js +0 -138
  1210. package/node_modules/moment/locale/sr.js +0 -140
  1211. package/node_modules/moment/locale/ss.js +0 -95
  1212. package/node_modules/moment/locale/sv.js +0 -79
  1213. package/node_modules/moment/locale/sw.js +0 -66
  1214. package/node_modules/moment/locale/ta.js +0 -142
  1215. package/node_modules/moment/locale/te.js +0 -99
  1216. package/node_modules/moment/locale/tet.js +0 -79
  1217. package/node_modules/moment/locale/tg.js +0 -128
  1218. package/node_modules/moment/locale/th.js +0 -76
  1219. package/node_modules/moment/locale/tk.js +0 -102
  1220. package/node_modules/moment/locale/tl-ph.js +0 -68
  1221. package/node_modules/moment/locale/tlh.js +0 -135
  1222. package/node_modules/moment/locale/tr.js +0 -117
  1223. package/node_modules/moment/locale/tzl.js +0 -100
  1224. package/node_modules/moment/locale/tzm-latn.js +0 -65
  1225. package/node_modules/moment/locale/tzm.js +0 -65
  1226. package/node_modules/moment/locale/ug-cn.js +0 -122
  1227. package/node_modules/moment/locale/uk.js +0 -178
  1228. package/node_modules/moment/locale/ur.js +0 -93
  1229. package/node_modules/moment/locale/uz-latn.js +0 -65
  1230. package/node_modules/moment/locale/uz.js +0 -62
  1231. package/node_modules/moment/locale/vi.js +0 -91
  1232. package/node_modules/moment/locale/x-pseudo.js +0 -84
  1233. package/node_modules/moment/locale/yo.js +0 -64
  1234. package/node_modules/moment/locale/zh-cn.js +0 -131
  1235. package/node_modules/moment/locale/zh-hk.js +0 -112
  1236. package/node_modules/moment/locale/zh-mo.js +0 -111
  1237. package/node_modules/moment/locale/zh-tw.js +0 -110
  1238. package/node_modules/moment/min/locales.js +0 -12570
  1239. package/node_modules/moment/min/locales.min.js +0 -2
  1240. package/node_modules/moment/min/locales.min.js.map +0 -1
  1241. package/node_modules/moment/min/moment-with-locales.js +0 -18239
  1242. package/node_modules/moment/min/moment-with-locales.min.js +0 -2
  1243. package/node_modules/moment/min/moment-with-locales.min.js.map +0 -1
  1244. package/node_modules/moment/min/moment.min.js +0 -2
  1245. package/node_modules/moment/min/moment.min.js.map +0 -1
  1246. package/node_modules/moment/moment.d.ts +0 -796
  1247. package/node_modules/moment/moment.js +0 -5685
  1248. package/node_modules/moment/package.js +0 -11
  1249. package/node_modules/moment/package.json +0 -116
  1250. package/node_modules/moment/src/lib/create/check-overflow.js +0 -57
  1251. package/node_modules/moment/src/lib/create/date-from-array.js +0 -35
  1252. package/node_modules/moment/src/lib/create/from-anything.js +0 -117
  1253. package/node_modules/moment/src/lib/create/from-array.js +0 -187
  1254. package/node_modules/moment/src/lib/create/from-object.js +0 -20
  1255. package/node_modules/moment/src/lib/create/from-string-and-array.js +0 -67
  1256. package/node_modules/moment/src/lib/create/from-string-and-format.js +0 -135
  1257. package/node_modules/moment/src/lib/create/from-string.js +0 -258
  1258. package/node_modules/moment/src/lib/create/local.js +0 -5
  1259. package/node_modules/moment/src/lib/create/parsing-flags.js +0 -28
  1260. package/node_modules/moment/src/lib/create/utc.js +0 -5
  1261. package/node_modules/moment/src/lib/create/valid.js +0 -51
  1262. package/node_modules/moment/src/lib/duration/abs.js +0 -18
  1263. package/node_modules/moment/src/lib/duration/add-subtract.js +0 -21
  1264. package/node_modules/moment/src/lib/duration/as.js +0 -88
  1265. package/node_modules/moment/src/lib/duration/bubble.js +0 -68
  1266. package/node_modules/moment/src/lib/duration/clone.js +0 -5
  1267. package/node_modules/moment/src/lib/duration/constructor.js +0 -42
  1268. package/node_modules/moment/src/lib/duration/create.js +0 -133
  1269. package/node_modules/moment/src/lib/duration/duration.js +0 -16
  1270. package/node_modules/moment/src/lib/duration/get.js +0 -27
  1271. package/node_modules/moment/src/lib/duration/humanize.js +0 -114
  1272. package/node_modules/moment/src/lib/duration/iso-string.js +0 -68
  1273. package/node_modules/moment/src/lib/duration/prototype.js +0 -78
  1274. package/node_modules/moment/src/lib/duration/valid.js +0 -55
  1275. package/node_modules/moment/src/lib/format/format.js +0 -104
  1276. package/node_modules/moment/src/lib/locale/base-config.js +0 -41
  1277. package/node_modules/moment/src/lib/locale/calendar.js +0 -15
  1278. package/node_modules/moment/src/lib/locale/constructor.js +0 -5
  1279. package/node_modules/moment/src/lib/locale/en.js +0 -39
  1280. package/node_modules/moment/src/lib/locale/formats.js +0 -36
  1281. package/node_modules/moment/src/lib/locale/invalid.js +0 -5
  1282. package/node_modules/moment/src/lib/locale/lists.js +0 -93
  1283. package/node_modules/moment/src/lib/locale/locale.js +0 -45
  1284. package/node_modules/moment/src/lib/locale/locales.js +0 -248
  1285. package/node_modules/moment/src/lib/locale/ordinal.js +0 -8
  1286. package/node_modules/moment/src/lib/locale/pre-post-format.js +0 -3
  1287. package/node_modules/moment/src/lib/locale/prototype.js +0 -88
  1288. package/node_modules/moment/src/lib/locale/relative.js +0 -32
  1289. package/node_modules/moment/src/lib/locale/set.js +0 -56
  1290. package/node_modules/moment/src/lib/moment/add-subtract.js +0 -61
  1291. package/node_modules/moment/src/lib/moment/calendar.js +0 -53
  1292. package/node_modules/moment/src/lib/moment/clone.js +0 -5
  1293. package/node_modules/moment/src/lib/moment/compare.js +0 -72
  1294. package/node_modules/moment/src/lib/moment/constructor.js +0 -80
  1295. package/node_modules/moment/src/lib/moment/creation-data.js +0 -9
  1296. package/node_modules/moment/src/lib/moment/diff.js +0 -79
  1297. package/node_modules/moment/src/lib/moment/format.js +0 -78
  1298. package/node_modules/moment/src/lib/moment/from.js +0 -20
  1299. package/node_modules/moment/src/lib/moment/get-set.js +0 -73
  1300. package/node_modules/moment/src/lib/moment/locale.js +0 -34
  1301. package/node_modules/moment/src/lib/moment/min-max.js +0 -62
  1302. package/node_modules/moment/src/lib/moment/moment.js +0 -28
  1303. package/node_modules/moment/src/lib/moment/now.js +0 -3
  1304. package/node_modules/moment/src/lib/moment/prototype.js +0 -197
  1305. package/node_modules/moment/src/lib/moment/start-end-of.js +0 -164
  1306. package/node_modules/moment/src/lib/moment/to-type.js +0 -42
  1307. package/node_modules/moment/src/lib/moment/to.js +0 -20
  1308. package/node_modules/moment/src/lib/moment/valid.js +0 -15
  1309. package/node_modules/moment/src/lib/parse/regex.js +0 -80
  1310. package/node_modules/moment/src/lib/parse/token.js +0 -36
  1311. package/node_modules/moment/src/lib/units/aliases.js +0 -31
  1312. package/node_modules/moment/src/lib/units/constants.js +0 -9
  1313. package/node_modules/moment/src/lib/units/day-of-month.js +0 -39
  1314. package/node_modules/moment/src/lib/units/day-of-week.js +0 -443
  1315. package/node_modules/moment/src/lib/units/day-of-year.js +0 -37
  1316. package/node_modules/moment/src/lib/units/era.js +0 -287
  1317. package/node_modules/moment/src/lib/units/hour.js +0 -159
  1318. package/node_modules/moment/src/lib/units/millisecond.js +0 -76
  1319. package/node_modules/moment/src/lib/units/minute.js +0 -29
  1320. package/node_modules/moment/src/lib/units/month.js +0 -349
  1321. package/node_modules/moment/src/lib/units/offset.js +0 -249
  1322. package/node_modules/moment/src/lib/units/priorities.js +0 -21
  1323. package/node_modules/moment/src/lib/units/quarter.js +0 -34
  1324. package/node_modules/moment/src/lib/units/second.js +0 -29
  1325. package/node_modules/moment/src/lib/units/timestamp.js +0 -20
  1326. package/node_modules/moment/src/lib/units/timezone.js +0 -16
  1327. package/node_modules/moment/src/lib/units/units.js +0 -20
  1328. package/node_modules/moment/src/lib/units/week-calendar-utils.js +0 -66
  1329. package/node_modules/moment/src/lib/units/week-year.js +0 -138
  1330. package/node_modules/moment/src/lib/units/week.js +0 -69
  1331. package/node_modules/moment/src/lib/units/year.js +0 -85
  1332. package/node_modules/moment/src/lib/utils/abs-ceil.js +0 -7
  1333. package/node_modules/moment/src/lib/utils/abs-floor.js +0 -8
  1334. package/node_modules/moment/src/lib/utils/abs-round.js +0 -7
  1335. package/node_modules/moment/src/lib/utils/compare-arrays.js +0 -18
  1336. package/node_modules/moment/src/lib/utils/defaults.js +0 -10
  1337. package/node_modules/moment/src/lib/utils/deprecate.js +0 -69
  1338. package/node_modules/moment/src/lib/utils/extend.js +0 -19
  1339. package/node_modules/moment/src/lib/utils/has-own-prop.js +0 -3
  1340. package/node_modules/moment/src/lib/utils/hooks.js +0 -13
  1341. package/node_modules/moment/src/lib/utils/index-of.js +0 -18
  1342. package/node_modules/moment/src/lib/utils/is-array.js +0 -6
  1343. package/node_modules/moment/src/lib/utils/is-calendar-spec.js +0 -25
  1344. package/node_modules/moment/src/lib/utils/is-date.js +0 -6
  1345. package/node_modules/moment/src/lib/utils/is-function.js +0 -6
  1346. package/node_modules/moment/src/lib/utils/is-leap-year.js +0 -3
  1347. package/node_modules/moment/src/lib/utils/is-moment-input.js +0 -75
  1348. package/node_modules/moment/src/lib/utils/is-number.js +0 -6
  1349. package/node_modules/moment/src/lib/utils/is-object-empty.js +0 -15
  1350. package/node_modules/moment/src/lib/utils/is-object.js +0 -8
  1351. package/node_modules/moment/src/lib/utils/is-string.js +0 -3
  1352. package/node_modules/moment/src/lib/utils/is-undefined.js +0 -3
  1353. package/node_modules/moment/src/lib/utils/keys.js +0 -20
  1354. package/node_modules/moment/src/lib/utils/map.js +0 -9
  1355. package/node_modules/moment/src/lib/utils/mod.js +0 -3
  1356. package/node_modules/moment/src/lib/utils/some.js +0 -20
  1357. package/node_modules/moment/src/lib/utils/to-int.js +0 -12
  1358. package/node_modules/moment/src/lib/utils/zero-fill.js +0 -10
  1359. package/node_modules/moment/src/locale/af.js +0 -71
  1360. package/node_modules/moment/src/locale/ar-dz.js +0 -156
  1361. package/node_modules/moment/src/locale/ar-kw.js +0 -55
  1362. package/node_modules/moment/src/locale/ar-ly.js +0 -171
  1363. package/node_modules/moment/src/locale/ar-ma.js +0 -56
  1364. package/node_modules/moment/src/locale/ar-sa.js +0 -105
  1365. package/node_modules/moment/src/locale/ar-tn.js +0 -55
  1366. package/node_modules/moment/src/locale/ar.js +0 -189
  1367. package/node_modules/moment/src/locale/az.js +0 -102
  1368. package/node_modules/moment/src/locale/be.js +0 -142
  1369. package/node_modules/moment/src/locale/bg.js +0 -87
  1370. package/node_modules/moment/src/locale/bm.js +0 -52
  1371. package/node_modules/moment/src/locale/bn-bd.js +0 -129
  1372. package/node_modules/moment/src/locale/bn.js +0 -119
  1373. package/node_modules/moment/src/locale/bo.js +0 -124
  1374. package/node_modules/moment/src/locale/br.js +0 -168
  1375. package/node_modules/moment/src/locale/bs.js +0 -150
  1376. package/node_modules/moment/src/locale/ca.js +0 -100
  1377. package/node_modules/moment/src/locale/cs.js +0 -180
  1378. package/node_modules/moment/src/locale/cv.js +0 -63
  1379. package/node_modules/moment/src/locale/cy.js +0 -98
  1380. package/node_modules/moment/src/locale/da.js +0 -53
  1381. package/node_modules/moment/src/locale/de-at.js +0 -79
  1382. package/node_modules/moment/src/locale/de-ch.js +0 -78
  1383. package/node_modules/moment/src/locale/de.js +0 -78
  1384. package/node_modules/moment/src/locale/dv.js +0 -90
  1385. package/node_modules/moment/src/locale/el.js +0 -106
  1386. package/node_modules/moment/src/locale/en-au.js +0 -68
  1387. package/node_modules/moment/src/locale/en-ca.js +0 -64
  1388. package/node_modules/moment/src/locale/en-gb.js +0 -68
  1389. package/node_modules/moment/src/locale/en-ie.js +0 -68
  1390. package/node_modules/moment/src/locale/en-il.js +0 -64
  1391. package/node_modules/moment/src/locale/en-in.js +0 -68
  1392. package/node_modules/moment/src/locale/en-nz.js +0 -68
  1393. package/node_modules/moment/src/locale/en-sg.js +0 -68
  1394. package/node_modules/moment/src/locale/eo.js +0 -68
  1395. package/node_modules/moment/src/locale/es-do.js +0 -108
  1396. package/node_modules/moment/src/locale/es-mx.js +0 -110
  1397. package/node_modules/moment/src/locale/es-us.js +0 -110
  1398. package/node_modules/moment/src/locale/es.js +0 -110
  1399. package/node_modules/moment/src/locale/et.js +0 -78
  1400. package/node_modules/moment/src/locale/eu.js +0 -65
  1401. package/node_modules/moment/src/locale/fa.js +0 -113
  1402. package/node_modules/moment/src/locale/fi.js +0 -124
  1403. package/node_modules/moment/src/locale/fil.js +0 -58
  1404. package/node_modules/moment/src/locale/fo.js +0 -57
  1405. package/node_modules/moment/src/locale/fr-ca.js +0 -70
  1406. package/node_modules/moment/src/locale/fr-ch.js +0 -74
  1407. package/node_modules/moment/src/locale/fr.js +0 -108
  1408. package/node_modules/moment/src/locale/fy.js +0 -75
  1409. package/node_modules/moment/src/locale/ga.js +0 -95
  1410. package/node_modules/moment/src/locale/gd.js +0 -95
  1411. package/node_modules/moment/src/locale/gl.js +0 -75
  1412. package/node_modules/moment/src/locale/gom-deva.js +0 -126
  1413. package/node_modules/moment/src/locale/gom-latn.js +0 -124
  1414. package/node_modules/moment/src/locale/gu.js +0 -122
  1415. package/node_modules/moment/src/locale/he.js +0 -94
  1416. package/node_modules/moment/src/locale/hi.js +0 -168
  1417. package/node_modules/moment/src/locale/hr.js +0 -156
  1418. package/node_modules/moment/src/locale/hu.js +0 -118
  1419. package/node_modules/moment/src/locale/hy-am.js +0 -94
  1420. package/node_modules/moment/src/locale/id.js +0 -76
  1421. package/node_modules/moment/src/locale/is.js +0 -140
  1422. package/node_modules/moment/src/locale/it-ch.js +0 -64
  1423. package/node_modules/moment/src/locale/it.js +0 -106
  1424. package/node_modules/moment/src/locale/ja.js +0 -148
  1425. package/node_modules/moment/src/locale/jv.js +0 -76
  1426. package/node_modules/moment/src/locale/ka.js +0 -92
  1427. package/node_modules/moment/src/locale/kk.js +0 -82
  1428. package/node_modules/moment/src/locale/km.js +0 -103
  1429. package/node_modules/moment/src/locale/kn.js +0 -124
  1430. package/node_modules/moment/src/locale/ko.js +0 -75
  1431. package/node_modules/moment/src/locale/ku.js +0 -118
  1432. package/node_modules/moment/src/locale/ky.js +0 -84
  1433. package/node_modules/moment/src/locale/lb.js +0 -137
  1434. package/node_modules/moment/src/locale/lo.js +0 -66
  1435. package/node_modules/moment/src/locale/lt.js +0 -125
  1436. package/node_modules/moment/src/locale/lv.js +0 -94
  1437. package/node_modules/moment/src/locale/me.js +0 -117
  1438. package/node_modules/moment/src/locale/mi.js +0 -60
  1439. package/node_modules/moment/src/locale/mk.js +0 -85
  1440. package/node_modules/moment/src/locale/ml.js +0 -82
  1441. package/node_modules/moment/src/locale/mn.js +0 -100
  1442. package/node_modules/moment/src/locale/mr.js +0 -203
  1443. package/node_modules/moment/src/locale/ms-my.js +0 -76
  1444. package/node_modules/moment/src/locale/ms.js +0 -75
  1445. package/node_modules/moment/src/locale/mt.js +0 -56
  1446. package/node_modules/moment/src/locale/my.js +0 -91
  1447. package/node_modules/moment/src/locale/nb.js +0 -60
  1448. package/node_modules/moment/src/locale/ne.js +0 -121
  1449. package/node_modules/moment/src/locale/nl-be.js +0 -102
  1450. package/node_modules/moment/src/locale/nl.js +0 -104
  1451. package/node_modules/moment/src/locale/nn.js +0 -59
  1452. package/node_modules/moment/src/locale/oc-lnc.js +0 -85
  1453. package/node_modules/moment/src/locale/pa-in.js +0 -122
  1454. package/node_modules/moment/src/locale/pl.js +0 -140
  1455. package/node_modules/moment/src/locale/pt-br.js +0 -58
  1456. package/node_modules/moment/src/locale/pt.js +0 -63
  1457. package/node_modules/moment/src/locale/ro.js +0 -76
  1458. package/node_modules/moment/src/locale/ru.js +0 -213
  1459. package/node_modules/moment/src/locale/sd.js +0 -81
  1460. package/node_modules/moment/src/locale/se.js +0 -57
  1461. package/node_modules/moment/src/locale/si.js +0 -69
  1462. package/node_modules/moment/src/locale/sk.js +0 -145
  1463. package/node_modules/moment/src/locale/sl.js +0 -171
  1464. package/node_modules/moment/src/locale/sq.js +0 -65
  1465. package/node_modules/moment/src/locale/sr-cyrl.js +0 -127
  1466. package/node_modules/moment/src/locale/sr.js +0 -129
  1467. package/node_modules/moment/src/locale/ss.js +0 -84
  1468. package/node_modules/moment/src/locale/sv.js +0 -68
  1469. package/node_modules/moment/src/locale/sw.js +0 -55
  1470. package/node_modules/moment/src/locale/ta.js +0 -131
  1471. package/node_modules/moment/src/locale/te.js +0 -88
  1472. package/node_modules/moment/src/locale/tet.js +0 -68
  1473. package/node_modules/moment/src/locale/tg.js +0 -117
  1474. package/node_modules/moment/src/locale/th.js +0 -65
  1475. package/node_modules/moment/src/locale/tk.js +0 -91
  1476. package/node_modules/moment/src/locale/tl-ph.js +0 -57
  1477. package/node_modules/moment/src/locale/tlh.js +0 -124
  1478. package/node_modules/moment/src/locale/tr.js +0 -106
  1479. package/node_modules/moment/src/locale/tzl.js +0 -89
  1480. package/node_modules/moment/src/locale/tzm-latn.js +0 -54
  1481. package/node_modules/moment/src/locale/tzm.js +0 -54
  1482. package/node_modules/moment/src/locale/ug-cn.js +0 -111
  1483. package/node_modules/moment/src/locale/uk.js +0 -167
  1484. package/node_modules/moment/src/locale/ur.js +0 -82
  1485. package/node_modules/moment/src/locale/uz-latn.js +0 -54
  1486. package/node_modules/moment/src/locale/uz.js +0 -51
  1487. package/node_modules/moment/src/locale/vi.js +0 -80
  1488. package/node_modules/moment/src/locale/x-pseudo.js +0 -73
  1489. package/node_modules/moment/src/locale/yo.js +0 -53
  1490. package/node_modules/moment/src/locale/zh-cn.js +0 -120
  1491. package/node_modules/moment/src/locale/zh-hk.js +0 -101
  1492. package/node_modules/moment/src/locale/zh-mo.js +0 -100
  1493. package/node_modules/moment/src/locale/zh-tw.js +0 -99
  1494. package/node_modules/moment/src/moment.js +0 -93
  1495. package/node_modules/moment/ts3.1-typings/moment.d.ts +0 -785
  1496. package/node_modules/ms/index.js +0 -162
  1497. package/node_modules/ms/license.md +0 -21
  1498. package/node_modules/ms/package.json +0 -41
  1499. package/node_modules/ms/readme.md +0 -60
  1500. package/node_modules/object-hash/.jshintrc +0 -19
  1501. package/node_modules/object-hash/.travis.yml +0 -35
  1502. package/node_modules/object-hash/LICENSE +0 -22
  1503. package/node_modules/object-hash/bower.json +0 -15
  1504. package/node_modules/object-hash/dist/object_hash.js +0 -2
  1505. package/node_modules/object-hash/dist/object_hash.js.map +0 -1
  1506. package/node_modules/object-hash/dist/object_hash_test.js +0 -4737
  1507. package/node_modules/object-hash/gulpfile.js +0 -97
  1508. package/node_modules/object-hash/index.js +0 -441
  1509. package/node_modules/object-hash/karma.conf.js +0 -69
  1510. package/node_modules/object-hash/package.json +0 -55
  1511. package/node_modules/object-hash/readme.markdown +0 -169
  1512. package/node_modules/object-hash/test/blob.js +0 -41
  1513. package/node_modules/object-hash/test/index.js +0 -290
  1514. package/node_modules/object-hash/test/object-classes.js +0 -106
  1515. package/node_modules/object-hash/test/old-crypto.js +0 -60
  1516. package/node_modules/object-hash/test/replacer.js +0 -36
  1517. package/node_modules/object-hash/test/types.js +0 -174
  1518. package/node_modules/object-hash/test/writeToStream.js +0 -27
  1519. package/node_modules/one-time/LICENSE +0 -22
  1520. package/node_modules/one-time/README.md +0 -88
  1521. package/node_modules/one-time/async.js +0 -43
  1522. package/node_modules/one-time/index.js +0 -42
  1523. package/node_modules/one-time/package.json +0 -38
  1524. package/node_modules/process-nextick-args/index.js +0 -45
  1525. package/node_modules/process-nextick-args/license.md +0 -19
  1526. package/node_modules/process-nextick-args/package.json +0 -29
  1527. package/node_modules/process-nextick-args/readme.md +0 -18
  1528. package/node_modules/readable-stream/.travis.yml +0 -34
  1529. package/node_modules/readable-stream/CONTRIBUTING.md +0 -38
  1530. package/node_modules/readable-stream/GOVERNANCE.md +0 -136
  1531. package/node_modules/readable-stream/LICENSE +0 -47
  1532. package/node_modules/readable-stream/README.md +0 -58
  1533. package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +0 -60
  1534. package/node_modules/readable-stream/duplex-browser.js +0 -1
  1535. package/node_modules/readable-stream/duplex.js +0 -1
  1536. package/node_modules/readable-stream/lib/_stream_duplex.js +0 -131
  1537. package/node_modules/readable-stream/lib/_stream_passthrough.js +0 -47
  1538. package/node_modules/readable-stream/lib/_stream_readable.js +0 -1019
  1539. package/node_modules/readable-stream/lib/_stream_transform.js +0 -214
  1540. package/node_modules/readable-stream/lib/_stream_writable.js +0 -687
  1541. package/node_modules/readable-stream/lib/internal/streams/BufferList.js +0 -79
  1542. package/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -74
  1543. package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
  1544. package/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
  1545. package/node_modules/readable-stream/package.json +0 -56
  1546. package/node_modules/readable-stream/passthrough.js +0 -1
  1547. package/node_modules/readable-stream/readable-browser.js +0 -7
  1548. package/node_modules/readable-stream/readable.js +0 -19
  1549. package/node_modules/readable-stream/transform.js +0 -1
  1550. package/node_modules/readable-stream/writable-browser.js +0 -1
  1551. package/node_modules/readable-stream/writable.js +0 -8
  1552. package/node_modules/safe-buffer/LICENSE +0 -21
  1553. package/node_modules/safe-buffer/README.md +0 -584
  1554. package/node_modules/safe-buffer/index.d.ts +0 -187
  1555. package/node_modules/safe-buffer/index.js +0 -62
  1556. package/node_modules/safe-buffer/package.json +0 -41
  1557. package/node_modules/safe-stable-stringify/CHANGELOG.md +0 -75
  1558. package/node_modules/safe-stable-stringify/LICENSE +0 -21
  1559. package/node_modules/safe-stable-stringify/esm/package.json +0 -4
  1560. package/node_modules/safe-stable-stringify/esm/wrapper.js +0 -6
  1561. package/node_modules/safe-stable-stringify/index.d.ts +0 -18
  1562. package/node_modules/safe-stable-stringify/index.js +0 -618
  1563. package/node_modules/safe-stable-stringify/package.json +0 -69
  1564. package/node_modules/safe-stable-stringify/readme.md +0 -170
  1565. package/node_modules/safe-stable-stringify/tsconfig.json +0 -22
  1566. package/node_modules/simple-swizzle/LICENSE +0 -21
  1567. package/node_modules/simple-swizzle/README.md +0 -39
  1568. package/node_modules/simple-swizzle/index.js +0 -29
  1569. package/node_modules/simple-swizzle/package.json +0 -40
  1570. package/node_modules/stack-trace/.npmignore +0 -1
  1571. package/node_modules/stack-trace/License +0 -19
  1572. package/node_modules/stack-trace/Makefile +0 -11
  1573. package/node_modules/stack-trace/Readme.md +0 -98
  1574. package/node_modules/stack-trace/lib/stack-trace.js +0 -136
  1575. package/node_modules/stack-trace/package.json +0 -25
  1576. package/node_modules/string_decoder/.travis.yml +0 -50
  1577. package/node_modules/string_decoder/LICENSE +0 -48
  1578. package/node_modules/string_decoder/README.md +0 -47
  1579. package/node_modules/string_decoder/lib/string_decoder.js +0 -296
  1580. package/node_modules/string_decoder/package.json +0 -35
  1581. package/node_modules/text-hex/LICENSE +0 -21
  1582. package/node_modules/text-hex/README.md +0 -20
  1583. package/node_modules/text-hex/index.js +0 -24
  1584. package/node_modules/text-hex/package.json +0 -34
  1585. package/node_modules/text-hex/test.js +0 -11
  1586. package/node_modules/triple-beam/.eslintrc +0 -7
  1587. package/node_modules/triple-beam/.gitattributes +0 -1
  1588. package/node_modules/triple-beam/.travis.yml +0 -17
  1589. package/node_modules/triple-beam/CHANGELOG.md +0 -22
  1590. package/node_modules/triple-beam/LICENSE +0 -21
  1591. package/node_modules/triple-beam/README.md +0 -34
  1592. package/node_modules/triple-beam/config/cli.js +0 -42
  1593. package/node_modules/triple-beam/config/index.js +0 -32
  1594. package/node_modules/triple-beam/config/npm.js +0 -36
  1595. package/node_modules/triple-beam/config/syslog.js +0 -38
  1596. package/node_modules/triple-beam/index.js +0 -46
  1597. package/node_modules/triple-beam/package.json +0 -40
  1598. package/node_modules/triple-beam/test.js +0 -98
  1599. package/node_modules/util-deprecate/History.md +0 -16
  1600. package/node_modules/util-deprecate/LICENSE +0 -24
  1601. package/node_modules/util-deprecate/README.md +0 -53
  1602. package/node_modules/util-deprecate/browser.js +0 -67
  1603. package/node_modules/util-deprecate/node.js +0 -6
  1604. package/node_modules/util-deprecate/package.json +0 -31
  1605. package/node_modules/winston/LICENSE +0 -19
  1606. package/node_modules/winston/README.md +0 -1231
  1607. package/node_modules/winston/dist/winston/common.js +0 -56
  1608. package/node_modules/winston/dist/winston/config/index.js +0 -37
  1609. package/node_modules/winston/dist/winston/container.js +0 -147
  1610. package/node_modules/winston/dist/winston/create-logger.js +0 -145
  1611. package/node_modules/winston/dist/winston/exception-handler.js +0 -288
  1612. package/node_modules/winston/dist/winston/exception-stream.js +0 -94
  1613. package/node_modules/winston/dist/winston/logger.js +0 -766
  1614. package/node_modules/winston/dist/winston/profiler.js +0 -69
  1615. package/node_modules/winston/dist/winston/rejection-handler.js +0 -288
  1616. package/node_modules/winston/dist/winston/tail-file.js +0 -135
  1617. package/node_modules/winston/dist/winston/transports/console.js +0 -166
  1618. package/node_modules/winston/dist/winston/transports/file.js +0 -817
  1619. package/node_modules/winston/dist/winston/transports/http.js +0 -342
  1620. package/node_modules/winston/dist/winston/transports/index.js +0 -55
  1621. package/node_modules/winston/dist/winston/transports/stream.js +0 -117
  1622. package/node_modules/winston/dist/winston.js +0 -166
  1623. package/node_modules/winston/index.d.ts +0 -213
  1624. package/node_modules/winston/lib/winston/common.js +0 -61
  1625. package/node_modules/winston/lib/winston/config/index.d.ts +0 -99
  1626. package/node_modules/winston/lib/winston/config/index.js +0 -35
  1627. package/node_modules/winston/lib/winston/container.js +0 -114
  1628. package/node_modules/winston/lib/winston/create-logger.js +0 -104
  1629. package/node_modules/winston/lib/winston/exception-handler.js +0 -245
  1630. package/node_modules/winston/lib/winston/exception-stream.js +0 -54
  1631. package/node_modules/winston/lib/winston/logger.js +0 -676
  1632. package/node_modules/winston/lib/winston/profiler.js +0 -51
  1633. package/node_modules/winston/lib/winston/rejection-handler.js +0 -251
  1634. package/node_modules/winston/lib/winston/tail-file.js +0 -124
  1635. package/node_modules/winston/lib/winston/transports/console.js +0 -117
  1636. package/node_modules/winston/lib/winston/transports/file.js +0 -695
  1637. package/node_modules/winston/lib/winston/transports/http.js +0 -267
  1638. package/node_modules/winston/lib/winston/transports/index.d.ts +0 -103
  1639. package/node_modules/winston/lib/winston/transports/index.js +0 -56
  1640. package/node_modules/winston/lib/winston/transports/stream.js +0 -63
  1641. package/node_modules/winston/lib/winston.js +0 -176
  1642. package/node_modules/winston/node_modules/readable-stream/CONTRIBUTING.md +0 -38
  1643. package/node_modules/winston/node_modules/readable-stream/GOVERNANCE.md +0 -136
  1644. package/node_modules/winston/node_modules/readable-stream/LICENSE +0 -47
  1645. package/node_modules/winston/node_modules/readable-stream/README.md +0 -106
  1646. package/node_modules/winston/node_modules/readable-stream/errors-browser.js +0 -127
  1647. package/node_modules/winston/node_modules/readable-stream/errors.js +0 -116
  1648. package/node_modules/winston/node_modules/readable-stream/experimentalWarning.js +0 -17
  1649. package/node_modules/winston/node_modules/readable-stream/lib/_stream_duplex.js +0 -139
  1650. package/node_modules/winston/node_modules/readable-stream/lib/_stream_passthrough.js +0 -39
  1651. package/node_modules/winston/node_modules/readable-stream/lib/_stream_readable.js +0 -1124
  1652. package/node_modules/winston/node_modules/readable-stream/lib/_stream_transform.js +0 -201
  1653. package/node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js +0 -697
  1654. package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/async_iterator.js +0 -207
  1655. package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -210
  1656. package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -105
  1657. package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -104
  1658. package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/from-browser.js +0 -3
  1659. package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/from.js +0 -64
  1660. package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -97
  1661. package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/state.js +0 -27
  1662. package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
  1663. package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
  1664. package/node_modules/winston/node_modules/readable-stream/package.json +0 -72
  1665. package/node_modules/winston/node_modules/readable-stream/readable-browser.js +0 -9
  1666. package/node_modules/winston/node_modules/readable-stream/readable.js +0 -16
  1667. package/node_modules/winston/node_modules/winston-transport/.babelrc +0 -3
  1668. package/node_modules/winston/node_modules/winston-transport/.eslintrc +0 -7
  1669. package/node_modules/winston/node_modules/winston-transport/.gitattributes +0 -1
  1670. package/node_modules/winston/node_modules/winston-transport/.nyc_output/c3d7ddb9-cc26-466b-a4f6-993ad69e86f6.json +0 -1
  1671. package/node_modules/winston/node_modules/winston-transport/.nyc_output/processinfo/c3d7ddb9-cc26-466b-a4f6-993ad69e86f6.json +0 -1
  1672. package/node_modules/winston/node_modules/winston-transport/.nyc_output/processinfo/index.json +0 -1
  1673. package/node_modules/winston/node_modules/winston-transport/CHANGELOG.md +0 -126
  1674. package/node_modules/winston/node_modules/winston-transport/LICENSE +0 -22
  1675. package/node_modules/winston/node_modules/winston-transport/README.md +0 -50
  1676. package/node_modules/winston/node_modules/winston-transport/dist/index.js +0 -215
  1677. package/node_modules/winston/node_modules/winston-transport/dist/legacy.js +0 -116
  1678. package/node_modules/winston/node_modules/winston-transport/index.d.ts +0 -39
  1679. package/node_modules/winston/node_modules/winston-transport/index.js +0 -215
  1680. package/node_modules/winston/node_modules/winston-transport/legacy.js +0 -119
  1681. package/node_modules/winston/node_modules/winston-transport/package.json +0 -56
  1682. package/node_modules/winston/package.json +0 -78
  1683. package/node_modules/winston-compat/.gitattributes +0 -1
  1684. package/node_modules/winston-compat/.node-version +0 -1
  1685. package/node_modules/winston-compat/CHANGELOG.md +0 -17
  1686. package/node_modules/winston-compat/LICENSE +0 -22
  1687. package/node_modules/winston-compat/README.md +0 -2
  1688. package/node_modules/winston-compat/index.js +0 -295
  1689. package/node_modules/winston-compat/lib/transport.js +0 -135
  1690. package/node_modules/winston-compat/node_modules/fecha/CHANGELOG.md +0 -11
  1691. package/node_modules/winston-compat/node_modules/fecha/LICENSE +0 -22
  1692. package/node_modules/winston-compat/node_modules/fecha/README.md +0 -259
  1693. package/node_modules/winston-compat/node_modules/fecha/fecha.d.ts +0 -47
  1694. package/node_modules/winston-compat/node_modules/fecha/fecha.js +0 -334
  1695. package/node_modules/winston-compat/node_modules/fecha/fecha.min.js +0 -1
  1696. package/node_modules/winston-compat/node_modules/fecha/package.json +0 -44
  1697. package/node_modules/winston-compat/node_modules/logform/.babelrc +0 -3
  1698. package/node_modules/winston-compat/node_modules/logform/.eslintrc +0 -7
  1699. package/node_modules/winston-compat/node_modules/logform/.gitattributes +0 -1
  1700. package/node_modules/winston-compat/node_modules/logform/.travis.yml +0 -17
  1701. package/node_modules/winston-compat/node_modules/logform/CHANGELOG.md +0 -103
  1702. package/node_modules/winston-compat/node_modules/logform/LICENSE +0 -21
  1703. package/node_modules/winston-compat/node_modules/logform/README.md +0 -170
  1704. package/node_modules/winston-compat/node_modules/logform/align.js +0 -14
  1705. package/node_modules/winston-compat/node_modules/logform/browser.js +0 -36
  1706. package/node_modules/winston-compat/node_modules/logform/cli.js +0 -52
  1707. package/node_modules/winston-compat/node_modules/logform/colorize.js +0 -118
  1708. package/node_modules/winston-compat/node_modules/logform/combine.js +0 -66
  1709. package/node_modules/winston-compat/node_modules/logform/dist/align.js +0 -14
  1710. package/node_modules/winston-compat/node_modules/logform/dist/browser.js +0 -37
  1711. package/node_modules/winston-compat/node_modules/logform/dist/cli.js +0 -75
  1712. package/node_modules/winston-compat/node_modules/logform/dist/colorize.js +0 -147
  1713. package/node_modules/winston-compat/node_modules/logform/dist/combine.js +0 -66
  1714. package/node_modules/winston-compat/node_modules/logform/dist/format.js +0 -69
  1715. package/node_modules/winston-compat/node_modules/logform/dist/index.js +0 -54
  1716. package/node_modules/winston-compat/node_modules/logform/dist/json.js +0 -27
  1717. package/node_modules/winston-compat/node_modules/logform/dist/label.js +0 -19
  1718. package/node_modules/winston-compat/node_modules/logform/dist/levels.js +0 -15
  1719. package/node_modules/winston-compat/node_modules/logform/dist/logstash.js +0 -32
  1720. package/node_modules/winston-compat/node_modules/logform/dist/metadata.js +0 -63
  1721. package/node_modules/winston-compat/node_modules/logform/dist/ms.js +0 -18
  1722. package/node_modules/winston-compat/node_modules/logform/dist/pad-levels.js +0 -118
  1723. package/node_modules/winston-compat/node_modules/logform/dist/pretty-print.js +0 -20
  1724. package/node_modules/winston-compat/node_modules/logform/dist/printf.js +0 -40
  1725. package/node_modules/winston-compat/node_modules/logform/dist/simple.js +0 -36
  1726. package/node_modules/winston-compat/node_modules/logform/dist/splat.js +0 -147
  1727. package/node_modules/winston-compat/node_modules/logform/dist/timestamp.js +0 -28
  1728. package/node_modules/winston-compat/node_modules/logform/dist/uncolorize.js +0 -31
  1729. package/node_modules/winston-compat/node_modules/logform/examples/combine.js +0 -14
  1730. package/node_modules/winston-compat/node_modules/logform/examples/filter.js +0 -30
  1731. package/node_modules/winston-compat/node_modules/logform/examples/invalid.js +0 -6
  1732. package/node_modules/winston-compat/node_modules/logform/examples/metadata.js +0 -78
  1733. package/node_modules/winston-compat/node_modules/logform/examples/padLevels.js +0 -39
  1734. package/node_modules/winston-compat/node_modules/logform/examples/volume.js +0 -25
  1735. package/node_modules/winston-compat/node_modules/logform/format.js +0 -52
  1736. package/node_modules/winston-compat/node_modules/logform/index.d.ts +0 -53
  1737. package/node_modules/winston-compat/node_modules/logform/index.js +0 -52
  1738. package/node_modules/winston-compat/node_modules/logform/json.js +0 -26
  1739. package/node_modules/winston-compat/node_modules/logform/label.js +0 -19
  1740. package/node_modules/winston-compat/node_modules/logform/levels.js +0 -12
  1741. package/node_modules/winston-compat/node_modules/logform/logstash.js +0 -29
  1742. package/node_modules/winston-compat/node_modules/logform/metadata.js +0 -61
  1743. package/node_modules/winston-compat/node_modules/logform/ms.js +0 -18
  1744. package/node_modules/winston-compat/node_modules/logform/package.json +0 -51
  1745. package/node_modules/winston-compat/node_modules/logform/pad-levels.js +0 -83
  1746. package/node_modules/winston-compat/node_modules/logform/pretty-print.js +0 -16
  1747. package/node_modules/winston-compat/node_modules/logform/printf.js +0 -26
  1748. package/node_modules/winston-compat/node_modules/logform/simple.js +0 -33
  1749. package/node_modules/winston-compat/node_modules/logform/splat.js +0 -125
  1750. package/node_modules/winston-compat/node_modules/logform/timestamp.js +0 -30
  1751. package/node_modules/winston-compat/node_modules/logform/tsconfig.json +0 -22
  1752. package/node_modules/winston-compat/node_modules/logform/uncolorize.js +0 -27
  1753. package/node_modules/winston-compat/package.json +0 -46
  1754. package/node_modules/winston-compat/test/clone.test.js +0 -25
  1755. package/node_modules/winston-compat/test/helpers.js +0 -256
  1756. package/node_modules/winston-compat/test/timestamp.test.js +0 -14
  1757. package/node_modules/winston-compat/test/transports/transport.js +0 -205
  1758. package/node_modules/winston-compat/test/winston-compat.test.js +0 -18
  1759. package/node_modules/winston-daily-rotate-file/.eslintrc.js +0 -11
  1760. package/node_modules/winston-daily-rotate-file/.node-version +0 -1
  1761. package/node_modules/winston-daily-rotate-file/.travis.yml +0 -15
  1762. package/node_modules/winston-daily-rotate-file/LICENSE +0 -22
  1763. package/node_modules/winston-daily-rotate-file/README.md +0 -67
  1764. package/node_modules/winston-daily-rotate-file/daily-rotate-file.js +0 -292
  1765. package/node_modules/winston-daily-rotate-file/index.d.ts +0 -73
  1766. package/node_modules/winston-daily-rotate-file/index.js +0 -7
  1767. package/node_modules/winston-daily-rotate-file/node_modules/semver/CHANGELOG.md +0 -70
  1768. package/node_modules/winston-daily-rotate-file/node_modules/semver/LICENSE +0 -15
  1769. package/node_modules/winston-daily-rotate-file/node_modules/semver/README.md +0 -443
  1770. package/node_modules/winston-daily-rotate-file/node_modules/semver/bin/semver.js +0 -174
  1771. package/node_modules/winston-daily-rotate-file/node_modules/semver/package.json +0 -32
  1772. package/node_modules/winston-daily-rotate-file/node_modules/semver/range.bnf +0 -16
  1773. package/node_modules/winston-daily-rotate-file/node_modules/semver/semver.js +0 -1596
  1774. package/node_modules/winston-daily-rotate-file/package.json +0 -54
  1775. package/node_modules/winston-daily-rotate-file/test/memory-stream.js +0 -38
  1776. package/node_modules/winston-daily-rotate-file/test/random-string.js +0 -31
  1777. package/node_modules/winston-daily-rotate-file/test/transport-tests.js +0 -250
  1778. package/node_modules/winston-transport/.babelrc +0 -3
  1779. package/node_modules/winston-transport/.eslintrc +0 -7
  1780. package/node_modules/winston-transport/.gitattributes +0 -1
  1781. package/node_modules/winston-transport/.nyc_output/1c69f3e4-4c25-457d-9df5-dfa761729528.json +0 -1
  1782. package/node_modules/winston-transport/.nyc_output/processinfo/1c69f3e4-4c25-457d-9df5-dfa761729528.json +0 -1
  1783. package/node_modules/winston-transport/.nyc_output/processinfo/index.json +0 -1
  1784. package/node_modules/winston-transport/.travis.yml +0 -17
  1785. package/node_modules/winston-transport/CHANGELOG.md +0 -115
  1786. package/node_modules/winston-transport/LICENSE +0 -22
  1787. package/node_modules/winston-transport/README.md +0 -50
  1788. package/node_modules/winston-transport/dist/index.js +0 -215
  1789. package/node_modules/winston-transport/dist/legacy.js +0 -116
  1790. package/node_modules/winston-transport/index.d.ts +0 -37
  1791. package/node_modules/winston-transport/index.js +0 -215
  1792. package/node_modules/winston-transport/legacy.js +0 -119
  1793. package/node_modules/winston-transport/package.json +0 -54
  1794. package/node_modules/winston-transport/tsconfig.json +0 -22
  1795. package/perf-logs.js +0 -155
  1796. package/system-diagnostics.js +0 -199
@@ -1,4737 +0,0 @@
1
- (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2
- (function (global){
3
- !function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.objectHash=e()}}(function(){return function e(t,n,r){function o(u,a){if(!n[u]){if(!t[u]){var f="function"==typeof require&&require;if(!a&&f)return f(u,!0);if(i)return i(u,!0);throw new Error("Cannot find module '"+u+"'")}var s=n[u]={exports:{}};t[u][0].call(s.exports,function(e){var n=t[u][1][e];return o(n?n:e)},s,s.exports,e,t,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(e,t,n){(function(r,o,i,u,a,f,s,c,l){"use strict";function d(e,t){return t=h(e,t),g(e,t)}function h(e,t){if(t=t||{},t.algorithm=t.algorithm||"sha1",t.encoding=t.encoding||"hex",t.excludeValues=!!t.excludeValues,t.algorithm=t.algorithm.toLowerCase(),t.encoding=t.encoding.toLowerCase(),t.ignoreUnknown=t.ignoreUnknown===!0,t.respectType=t.respectType!==!1,t.respectFunctionNames=t.respectFunctionNames!==!1,t.respectFunctionProperties=t.respectFunctionProperties!==!1,t.unorderedArrays=t.unorderedArrays===!0,t.unorderedSets=t.unorderedSets!==!1,t.unorderedObjects=t.unorderedObjects!==!1,t.replacer=t.replacer||void 0,t.excludeKeys=t.excludeKeys||void 0,"undefined"==typeof e)throw new Error("Object argument required.");for(var n=0;n<v.length;++n)v[n].toLowerCase()===t.algorithm.toLowerCase()&&(t.algorithm=v[n]);if(v.indexOf(t.algorithm)===-1)throw new Error('Algorithm "'+t.algorithm+'" not supported. supported values: '+v.join(", "));if(m.indexOf(t.encoding)===-1&&"passthrough"!==t.algorithm)throw new Error('Encoding "'+t.encoding+'" not supported. supported values: '+m.join(", "));return t}function p(e){if("function"!=typeof e)return!1;var t=/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i;return null!=t.exec(Function.prototype.toString.call(e))}function g(e,t){var n;n="passthrough"!==t.algorithm?b.createHash(t.algorithm):new w,"undefined"==typeof n.write&&(n.write=n.update,n.end=n.update);var r=y(t,n);if(r.dispatch(e),n.update||n.end(""),n.digest)return n.digest("buffer"===t.encoding?void 0:t.encoding);var o=n.read();return"buffer"===t.encoding?o:o.toString(t.encoding)}function y(e,t,n){n=n||[];var r=function(e){return t.update?t.update(e,"utf8"):t.write(e,"utf8")};return{dispatch:function(t){e.replacer&&(t=e.replacer(t));var n=typeof t;return null===t&&(n="null"),this["_"+n](t)},_object:function(t){var o=/\[object (.*)\]/i,u=Object.prototype.toString.call(t),a=o.exec(u);a=a?a[1]:"unknown:["+u+"]",a=a.toLowerCase();var f=null;if((f=n.indexOf(t))>=0)return this.dispatch("[CIRCULAR:"+f+"]");if(n.push(t),"undefined"!=typeof i&&i.isBuffer&&i.isBuffer(t))return r("buffer:"),r(t);if("object"===a||"function"===a){var s=Object.keys(t);e.unorderedObjects&&(s=s.sort()),e.respectType===!1||p(t)||s.splice(0,0,"prototype","__proto__","constructor"),e.excludeKeys&&(s=s.filter(function(t){return!e.excludeKeys(t)})),r("object:"+s.length+":");var c=this;return s.forEach(function(n){c.dispatch(n),r(":"),e.excludeValues||c.dispatch(t[n]),r(",")})}if(!this["_"+a]){if(e.ignoreUnknown)return r("["+a+"]");throw new Error('Unknown object type "'+a+'"')}this["_"+a](t)},_array:function(t,o){o="undefined"!=typeof o?o:e.unorderedArrays!==!1;var i=this;if(r("array:"+t.length+":"),!o||t.length<=1)return t.forEach(function(e){return i.dispatch(e)});var u=[],a=t.map(function(t){var r=new w,o=n.slice(),i=y(e,r,o);return i.dispatch(t),u=u.concat(o.slice(n.length)),r.read().toString()});return n=n.concat(u),a.sort(),this._array(a,!1)},_date:function(e){return r("date:"+e.toJSON())},_symbol:function(e){return r("symbol:"+e.toString())},_error:function(e){return r("error:"+e.toString())},_boolean:function(e){return r("bool:"+e.toString())},_string:function(e){r("string:"+e.length+":"),r(e.toString())},_function:function(t){r("fn:"),p(t)?this.dispatch("[native]"):this.dispatch(t.toString()),e.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(t.name)),e.respectFunctionProperties&&this._object(t)},_number:function(e){return r("number:"+e.toString())},_xml:function(e){return r("xml:"+e.toString())},_null:function(){return r("Null")},_undefined:function(){return r("Undefined")},_regexp:function(e){return r("regex:"+e.toString())},_uint8array:function(e){return r("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint8clampedarray:function(e){return r("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(e))},_int8array:function(e){return r("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint16array:function(e){return r("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_int16array:function(e){return r("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_uint32array:function(e){return r("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_int32array:function(e){return r("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_float32array:function(e){return r("float32array:"),this.dispatch(Array.prototype.slice.call(e))},_float64array:function(e){return r("float64array:"),this.dispatch(Array.prototype.slice.call(e))},_arraybuffer:function(e){return r("arraybuffer:"),this.dispatch(new Uint8Array(e))},_url:function(e){return r("url:"+e.toString(),"utf8")},_map:function(t){r("map:");var n=Array.from(t);return this._array(n,e.unorderedSets!==!1)},_set:function(t){r("set:");var n=Array.from(t);return this._array(n,e.unorderedSets!==!1)},_blob:function(){if(e.ignoreUnknown)return r("[blob]");throw Error('Hashing Blob objects is currently not supported\n(see https://github.com/puleos/object-hash/issues/26)\nUse "options.replacer" or "options.ignoreUnknown"\n')},_domwindow:function(){return r("domwindow")},_process:function(){return r("process")},_timer:function(){return r("timer")},_pipe:function(){return r("pipe")},_tcp:function(){return r("tcp")},_udp:function(){return r("udp")},_tty:function(){return r("tty")},_statwatcher:function(){return r("statwatcher")},_securecontext:function(){return r("securecontext")},_connection:function(){return r("connection")},_zlib:function(){return r("zlib")},_context:function(){return r("context")},_nodescript:function(){return r("nodescript")},_httpparser:function(){return r("httpparser")},_dataview:function(){return r("dataview")},_signal:function(){return r("signal")},_fsevent:function(){return r("fsevent")},_tlswrap:function(){return r("tlswrap")}}}function w(){return{buf:"",write:function(e){this.buf+=e},end:function(e){this.buf+=e},read:function(){return this.buf}}}var b=e("crypto");n=t.exports=d,n.sha1=function(e){return d(e)},n.keys=function(e){return d(e,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},n.MD5=function(e){return d(e,{algorithm:"md5",encoding:"hex"})},n.keysMD5=function(e){return d(e,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var v=b.getHashes?b.getHashes().slice():["sha1","md5"];v.push("passthrough");var m=["buffer","hex","binary","base64"];n.writeToStream=function(e,t,n){return"undefined"==typeof n&&(n=t,t={}),t=h(e,t),y(t,n).dispatch(e)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_e8180ef5.js","/")},{buffer:3,crypto:5,lYpoI2:10}],2:[function(e,t,n){(function(e,t,r,o,i,u,a,f,s){var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(e){"use strict";function t(e){var t=e.charCodeAt(0);return t===i||t===l?62:t===u||t===d?63:t<a?-1:t<a+10?t-a+26+26:t<s+26?t-s:t<f+26?t-f+26:void 0}function n(e){function n(e){s[l++]=e}var r,i,u,a,f,s;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=e.length;f="="===e.charAt(c-2)?2:"="===e.charAt(c-1)?1:0,s=new o(3*e.length/4-f),u=f>0?e.length-4:e.length;var l=0;for(r=0,i=0;r<u;r+=4,i+=3)a=t(e.charAt(r))<<18|t(e.charAt(r+1))<<12|t(e.charAt(r+2))<<6|t(e.charAt(r+3)),n((16711680&a)>>16),n((65280&a)>>8),n(255&a);return 2===f?(a=t(e.charAt(r))<<2|t(e.charAt(r+1))>>4,n(255&a)):1===f&&(a=t(e.charAt(r))<<10|t(e.charAt(r+1))<<4|t(e.charAt(r+2))>>2,n(a>>8&255),n(255&a)),s}function r(e){function t(e){return c.charAt(e)}function n(e){return t(e>>18&63)+t(e>>12&63)+t(e>>6&63)+t(63&e)}var r,o,i,u=e.length%3,a="";for(r=0,i=e.length-u;r<i;r+=3)o=(e[r]<<16)+(e[r+1]<<8)+e[r+2],a+=n(o);switch(u){case 1:o=e[e.length-1],a+=t(o>>2),a+=t(o<<4&63),a+="==";break;case 2:o=(e[e.length-2]<<8)+e[e.length-1],a+=t(o>>10),a+=t(o>>4&63),a+=t(o<<2&63),a+="="}return a}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="+".charCodeAt(0),u="/".charCodeAt(0),a="0".charCodeAt(0),f="a".charCodeAt(0),s="A".charCodeAt(0),l="-".charCodeAt(0),d="_".charCodeAt(0);e.toByteArray=n,e.fromByteArray=r}("undefined"==typeof n?this.base64js={}:n)}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:10}],3:[function(e,t,n){(function(t,r,o,i,u,a,f,s,c){function o(e,t,n){if(!(this instanceof o))return new o(e,t,n);var r=typeof e;if("base64"===t&&"string"===r)for(e=N(e);e.length%4!==0;)e+="=";var i;if("number"===r)i=F(e);else if("string"===r)i=o.byteLength(e,t);else{if("object"!==r)throw new Error("First argument needs to be a number, array or string.");i=F(e.length)}var u;o._useTypedArrays?u=o._augment(new Uint8Array(i)):(u=this,u.length=i,u._isBuffer=!0);var a;if(o._useTypedArrays&&"number"==typeof e.byteLength)u._set(e);else if(O(e))for(a=0;a<i;a++)o.isBuffer(e)?u[a]=e.readUInt8(a):u[a]=e[a];else if("string"===r)u.write(e,0,t);else if("number"===r&&!o._useTypedArrays&&!n)for(a=0;a<i;a++)u[a]=0;return u}function l(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var u=t.length;$(u%2===0,"Invalid hex string"),r>u/2&&(r=u/2);for(var a=0;a<r;a++){var f=parseInt(t.substr(2*a,2),16);$(!isNaN(f),"Invalid hex string"),e[n+a]=f}return o._charsWritten=2*a,a}function d(e,t,n,r){var i=o._charsWritten=W(V(t),e,n,r);return i}function h(e,t,n,r){var i=o._charsWritten=W(q(t),e,n,r);return i}function p(e,t,n,r){return h(e,t,n,r)}function g(e,t,n,r){var i=o._charsWritten=W(R(t),e,n,r);return i}function y(e,t,n,r){var i=o._charsWritten=W(P(t),e,n,r);return i}function w(e,t,n){return 0===t&&n===e.length?G.fromByteArray(e):G.fromByteArray(e.slice(t,n))}function b(e,t,n){var r="",o="";n=Math.min(e.length,n);for(var i=t;i<n;i++)e[i]<=127?(r+=J(o)+String.fromCharCode(e[i]),o=""):o+="%"+e[i].toString(16);return r+J(o)}function v(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;o++)r+=String.fromCharCode(e[o]);return r}function m(e,t,n){return v(e,t,n)}function _(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;i++)o+=H(e[i]);return o}function E(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function I(e,t,n,r){r||($("boolean"==typeof n,"missing or invalid endian"),$(void 0!==t&&null!==t,"missing offset"),$(t+1<e.length,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){var i;return n?(i=e[t],t+1<o&&(i|=e[t+1]<<8)):(i=e[t]<<8,t+1<o&&(i|=e[t+1])),i}}function A(e,t,n,r){r||($("boolean"==typeof n,"missing or invalid endian"),$(void 0!==t&&null!==t,"missing offset"),$(t+3<e.length,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){var i;return n?(t+2<o&&(i=e[t+2]<<16),t+1<o&&(i|=e[t+1]<<8),i|=e[t],t+3<o&&(i+=e[t+3]<<24>>>0)):(t+1<o&&(i=e[t+1]<<16),t+2<o&&(i|=e[t+2]<<8),t+3<o&&(i|=e[t+3]),i+=e[t]<<24>>>0),i}}function B(e,t,n,r){r||($("boolean"==typeof n,"missing or invalid endian"),$(void 0!==t&&null!==t,"missing offset"),$(t+1<e.length,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){var i=I(e,t,n,!0),u=32768&i;return u?(65535-i+1)*-1:i}}function L(e,t,n,r){r||($("boolean"==typeof n,"missing or invalid endian"),$(void 0!==t&&null!==t,"missing offset"),$(t+3<e.length,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){var i=A(e,t,n,!0),u=2147483648&i;return u?(4294967295-i+1)*-1:i}}function U(e,t,n,r){return r||($("boolean"==typeof n,"missing or invalid endian"),$(t+3<e.length,"Trying to read beyond buffer length")),Q.read(e,t,n,23,4)}function x(e,t,n,r){return r||($("boolean"==typeof n,"missing or invalid endian"),$(t+7<e.length,"Trying to read beyond buffer length")),Q.read(e,t,n,52,8)}function S(e,t,n,r,o){o||($(void 0!==t&&null!==t,"missing value"),$("boolean"==typeof r,"missing or invalid endian"),$(void 0!==n&&null!==n,"missing offset"),$(n+1<e.length,"trying to write beyond buffer length"),K(t,65535));var i=e.length;if(!(n>=i))for(var u=0,a=Math.min(i-n,2);u<a;u++)e[n+u]=(t&255<<8*(r?u:1-u))>>>8*(r?u:1-u)}function j(e,t,n,r,o){o||($(void 0!==t&&null!==t,"missing value"),$("boolean"==typeof r,"missing or invalid endian"),$(void 0!==n&&null!==n,"missing offset"),$(n+3<e.length,"trying to write beyond buffer length"),K(t,4294967295));var i=e.length;if(!(n>=i))for(var u=0,a=Math.min(i-n,4);u<a;u++)e[n+u]=t>>>8*(r?u:3-u)&255}function C(e,t,n,r,o){o||($(void 0!==t&&null!==t,"missing value"),$("boolean"==typeof r,"missing or invalid endian"),$(void 0!==n&&null!==n,"missing offset"),$(n+1<e.length,"Trying to write beyond buffer length"),z(t,32767,-32768));var i=e.length;n>=i||(t>=0?S(e,t,n,r,o):S(e,65535+t+1,n,r,o))}function k(e,t,n,r,o){o||($(void 0!==t&&null!==t,"missing value"),$("boolean"==typeof r,"missing or invalid endian"),$(void 0!==n&&null!==n,"missing offset"),$(n+3<e.length,"Trying to write beyond buffer length"),z(t,2147483647,-2147483648));var i=e.length;n>=i||(t>=0?j(e,t,n,r,o):j(e,4294967295+t+1,n,r,o))}function T(e,t,n,r,o){o||($(void 0!==t&&null!==t,"missing value"),$("boolean"==typeof r,"missing or invalid endian"),$(void 0!==n&&null!==n,"missing offset"),$(n+3<e.length,"Trying to write beyond buffer length"),X(t,3.4028234663852886e38,-3.4028234663852886e38));var i=e.length;n>=i||Q.write(e,t,n,r,23,4)}function M(e,t,n,r,o){o||($(void 0!==t&&null!==t,"missing value"),$("boolean"==typeof r,"missing or invalid endian"),$(void 0!==n&&null!==n,"missing offset"),$(n+7<e.length,"Trying to write beyond buffer length"),X(t,1.7976931348623157e308,-1.7976931348623157e308));var i=e.length;n>=i||Q.write(e,t,n,r,52,8)}function N(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Y(e,t,n){return"number"!=typeof e?n:(e=~~e,e>=t?t:e>=0?e:(e+=t,e>=0?e:0))}function F(e){return e=~~Math.ceil(+e),e<0?0:e}function D(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function O(e){return D(e)||o.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function H(e){return e<16?"0"+e.toString(16):e.toString(16)}function V(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<=127)t.push(e.charCodeAt(n));else{var o=n;r>=55296&&r<=57343&&n++;for(var i=encodeURIComponent(e.slice(o,n+1)).substr(1).split("%"),u=0;u<i.length;u++)t.push(parseInt(i[u],16))}}return t}function q(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}function P(e){for(var t,n,r,o=[],i=0;i<e.length;i++)t=e.charCodeAt(i),n=t>>8,r=t%256,o.push(r),o.push(n);return o}function R(e){return G.toByteArray(e)}function W(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);o++)t[o+n]=e[o];return o}function J(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function K(e,t){$("number"==typeof e,"cannot write a non-number as a number"),$(e>=0,"specified a negative value for writing an unsigned value"),$(e<=t,"value is larger than maximum value for type"),$(Math.floor(e)===e,"value has a fractional component")}function z(e,t,n){$("number"==typeof e,"cannot write a non-number as a number"),$(e<=t,"value larger than maximum allowed value"),$(e>=n,"value smaller than minimum allowed value"),$(Math.floor(e)===e,"value has a fractional component")}function X(e,t,n){$("number"==typeof e,"cannot write a non-number as a number"),$(e<=t,"value larger than maximum allowed value"),$(e>=n,"value smaller than minimum allowed value")}function $(e,t){if(!e)throw new Error(t||"Failed assertion")}var G=e("base64-js"),Q=e("ieee754");n.Buffer=o,n.SlowBuffer=o,n.INSPECT_MAX_BYTES=50,o.poolSize=8192,o._useTypedArrays=function(){try{var e=new ArrayBuffer(0),t=new Uint8Array(e);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray}catch(n){return!1}}(),o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.isBuffer=function(e){return!(null===e||void 0===e||!e._isBuffer)},o.byteLength=function(e,t){var n;switch(e+="",t||"utf8"){case"hex":n=e.length/2;break;case"utf8":case"utf-8":n=V(e).length;break;case"ascii":case"binary":case"raw":n=e.length;break;case"base64":n=R(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*e.length;break;default:throw new Error("Unknown encoding")}return n},o.concat=function(e,t){if($(D(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new o(0);if(1===e.length)return e[0];var n;if("number"!=typeof t)for(t=0,n=0;n<e.length;n++)t+=e[n].length;var r=new o(t),i=0;for(n=0;n<e.length;n++){var u=e[n];u.copy(r,i),i+=u.length}return r},o.prototype.write=function(e,t,n,r){if(isFinite(t))isFinite(n)||(r=n,n=void 0);else{var o=r;r=t,t=n,n=o}t=Number(t)||0;var i=this.length-t;n?(n=Number(n),n>i&&(n=i)):n=i,r=String(r||"utf8").toLowerCase();var u;switch(r){case"hex":u=l(this,e,t,n);break;case"utf8":case"utf-8":u=d(this,e,t,n);break;case"ascii":u=h(this,e,t,n);break;case"binary":u=p(this,e,t,n);break;case"base64":u=g(this,e,t,n);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":u=y(this,e,t,n);break;default:throw new Error("Unknown encoding")}return u},o.prototype.toString=function(e,t,n){var r=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,n=void 0!==n?Number(n):n=r.length,n===t)return"";var o;switch(e){case"hex":o=_(r,t,n);break;case"utf8":case"utf-8":o=b(r,t,n);break;case"ascii":o=v(r,t,n);break;case"binary":o=m(r,t,n);break;case"base64":o=w(r,t,n);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":o=E(r,t,n);break;default:throw new Error("Unknown encoding")}return o},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.copy=function(e,t,n,r){var i=this;if(n||(n=0),r||0===r||(r=this.length),t||(t=0),r!==n&&0!==e.length&&0!==i.length){$(r>=n,"sourceEnd < sourceStart"),$(t>=0&&t<e.length,"targetStart out of bounds"),$(n>=0&&n<i.length,"sourceStart out of bounds"),$(r>=0&&r<=i.length,"sourceEnd out of bounds"),r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var u=r-n;if(u<100||!o._useTypedArrays)for(var a=0;a<u;a++)e[a+t]=this[a+n];else e._set(this.subarray(n,n+u),t)}},o.prototype.slice=function(e,t){var n=this.length;if(e=Y(e,n,0),t=Y(t,n,n),o._useTypedArrays)return o._augment(this.subarray(e,t));for(var r=t-e,i=new o(r,(void 0),(!0)),u=0;u<r;u++)i[u]=this[u+e];return i},o.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},o.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},o.prototype.readUInt8=function(e,t){if(t||($(void 0!==e&&null!==e,"missing offset"),$(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return this[e]},o.prototype.readUInt16LE=function(e,t){return I(this,e,!0,t)},o.prototype.readUInt16BE=function(e,t){return I(this,e,!1,t)},o.prototype.readUInt32LE=function(e,t){return A(this,e,!0,t)},o.prototype.readUInt32BE=function(e,t){return A(this,e,!1,t)},o.prototype.readInt8=function(e,t){if(t||($(void 0!==e&&null!==e,"missing offset"),$(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length)){var n=128&this[e];return n?(255-this[e]+1)*-1:this[e]}},o.prototype.readInt16LE=function(e,t){return B(this,e,!0,t)},o.prototype.readInt16BE=function(e,t){return B(this,e,!1,t)},o.prototype.readInt32LE=function(e,t){return L(this,e,!0,t)},o.prototype.readInt32BE=function(e,t){return L(this,e,!1,t)},o.prototype.readFloatLE=function(e,t){return U(this,e,!0,t)},o.prototype.readFloatBE=function(e,t){return U(this,e,!1,t)},o.prototype.readDoubleLE=function(e,t){return x(this,e,!0,t)},o.prototype.readDoubleBE=function(e,t){return x(this,e,!1,t)},o.prototype.writeUInt8=function(e,t,n){n||($(void 0!==e&&null!==e,"missing value"),$(void 0!==t&&null!==t,"missing offset"),$(t<this.length,"trying to write beyond buffer length"),K(e,255)),t>=this.length||(this[t]=e)},o.prototype.writeUInt16LE=function(e,t,n){S(this,e,t,!0,n)},o.prototype.writeUInt16BE=function(e,t,n){S(this,e,t,!1,n)},o.prototype.writeUInt32LE=function(e,t,n){j(this,e,t,!0,n)},o.prototype.writeUInt32BE=function(e,t,n){j(this,e,t,!1,n)},o.prototype.writeInt8=function(e,t,n){n||($(void 0!==e&&null!==e,"missing value"),$(void 0!==t&&null!==t,"missing offset"),$(t<this.length,"Trying to write beyond buffer length"),z(e,127,-128)),t>=this.length||(e>=0?this.writeUInt8(e,t,n):this.writeUInt8(255+e+1,t,n))},o.prototype.writeInt16LE=function(e,t,n){C(this,e,t,!0,n)},o.prototype.writeInt16BE=function(e,t,n){C(this,e,t,!1,n)},o.prototype.writeInt32LE=function(e,t,n){k(this,e,t,!0,n)},o.prototype.writeInt32BE=function(e,t,n){k(this,e,t,!1,n)},o.prototype.writeFloatLE=function(e,t,n){T(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){T(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){M(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){M(this,e,t,!1,n)},o.prototype.fill=function(e,t,n){if(e||(e=0),t||(t=0),n||(n=this.length),"string"==typeof e&&(e=e.charCodeAt(0)),$("number"==typeof e&&!isNaN(e),"value is not a number"),$(n>=t,"end < start"),n!==t&&0!==this.length){$(t>=0&&t<this.length,"start out of bounds"),$(n>=0&&n<=this.length,"end out of bounds");for(var r=t;r<n;r++)this[r]=e}},o.prototype.inspect=function(){for(var e=[],t=this.length,r=0;r<t;r++)if(e[r]=H(this[r]),r===n.INSPECT_MAX_BYTES){e[r+1]="...";break}return"<Buffer "+e.join(" ")+">"},o.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(o._useTypedArrays)return new o(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;t<n;t+=1)e[t]=this[t];return e.buffer}throw new Error("Buffer.toArrayBuffer not supported in this browser")};var Z=o.prototype;o._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=Z.get,e.set=Z.set,e.write=Z.write,e.toString=Z.toString,e.toLocaleString=Z.toString,e.toJSON=Z.toJSON,e.copy=Z.copy,e.slice=Z.slice,e.readUInt8=Z.readUInt8,e.readUInt16LE=Z.readUInt16LE,e.readUInt16BE=Z.readUInt16BE,e.readUInt32LE=Z.readUInt32LE,e.readUInt32BE=Z.readUInt32BE,e.readInt8=Z.readInt8,e.readInt16LE=Z.readInt16LE,e.readInt16BE=Z.readInt16BE,e.readInt32LE=Z.readInt32LE,e.readInt32BE=Z.readInt32BE,e.readFloatLE=Z.readFloatLE,e.readFloatBE=Z.readFloatBE,e.readDoubleLE=Z.readDoubleLE,e.readDoubleBE=Z.readDoubleBE,e.writeUInt8=Z.writeUInt8,e.writeUInt16LE=Z.writeUInt16LE,e.writeUInt16BE=Z.writeUInt16BE,e.writeUInt32LE=Z.writeUInt32LE,e.writeUInt32BE=Z.writeUInt32BE,e.writeInt8=Z.writeInt8,e.writeInt16LE=Z.writeInt16LE,e.writeInt16BE=Z.writeInt16BE,e.writeInt32LE=Z.writeInt32LE,e.writeInt32BE=Z.writeInt32BE,e.writeFloatLE=Z.writeFloatLE,e.writeFloatBE=Z.writeFloatBE,e.writeDoubleLE=Z.writeDoubleLE,e.writeDoubleBE=Z.writeDoubleBE,e.fill=Z.fill,e.inspect=Z.inspect,e.toArrayBuffer=Z.toArrayBuffer,e}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:11,lYpoI2:10}],4:[function(e,t,n){(function(n,r,o,i,u,a,f,s,c){function l(e,t){if(e.length%p!==0){var n=e.length+(p-e.length%p);e=o.concat([e,g],n)}for(var r=[],i=t?e.readInt32BE:e.readInt32LE,u=0;u<e.length;u+=p)r.push(i.call(e,u));return r}function d(e,t,n){for(var r=new o(t),i=n?r.writeInt32BE:r.writeInt32LE,u=0;u<e.length;u++)i.call(r,e[u],4*u,!0);return r}function h(e,t,n,r){o.isBuffer(e)||(e=new o(e));var i=t(l(e,r),e.length*y);return d(i,n,r)}var o=e("buffer").Buffer,p=4,g=new o(p);g.fill(0);var y=8;t.exports={hash:h}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:10}],5:[function(e,t,n){(function(t,r,o,i,u,a,f,s,c){function l(e,t,n){o.isBuffer(t)||(t=new o(t)),o.isBuffer(n)||(n=new o(n)),t.length>m?t=e(t):t.length<m&&(t=o.concat([t,_],m));for(var r=new o(m),i=new o(m),u=0;u<m;u++)r[u]=54^t[u],i[u]=92^t[u];var a=e(o.concat([r,n]));return e(o.concat([i,a]))}function d(e,t){e=e||"sha1";var n=v[e],r=[],i=0;return n||h("algorithm:",e,"is not yet supported"),{update:function(e){return o.isBuffer(e)||(e=new o(e)),r.push(e),i+=e.length,this},digest:function(e){var i=o.concat(r),u=t?l(n,t,i):n(i);return r=null,e?u.toString(e):u}}}function h(){var e=[].slice.call(arguments).join(" ");throw new Error([e,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}function p(e,t){for(var n in e)t(e[n],n)}var o=e("buffer").Buffer,g=e("./sha"),y=e("./sha256"),w=e("./rng"),b=e("./md5"),v={sha1:g,sha256:y,md5:b},m=64,_=new o(m);_.fill(0),n.createHash=function(e){return d(e)},n.createHmac=function(e,t){return d(e,t)},n.randomBytes=function(e,t){if(!t||!t.call)return new o(w(e));try{t.call(this,void 0,new o(w(e)))}catch(n){t(n)}},p(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],function(e){n[e]=function(){h("sorry,",e,"is not implemented yet")}})}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:10}],6:[function(e,t,n){(function(n,r,o,i,u,a,f,s,c){function l(e,t){e[t>>5]|=128<<t%32,e[(t+64>>>9<<4)+14]=t;for(var n=1732584193,r=-271733879,o=-1732584194,i=271733878,u=0;u<e.length;u+=16){var a=n,f=r,s=o,c=i;n=h(n,r,o,i,e[u+0],7,-680876936),i=h(i,n,r,o,e[u+1],12,-389564586),o=h(o,i,n,r,e[u+2],17,606105819),r=h(r,o,i,n,e[u+3],22,-1044525330),n=h(n,r,o,i,e[u+4],7,-176418897),i=h(i,n,r,o,e[u+5],12,1200080426),o=h(o,i,n,r,e[u+6],17,-1473231341),r=h(r,o,i,n,e[u+7],22,-45705983),n=h(n,r,o,i,e[u+8],7,1770035416),i=h(i,n,r,o,e[u+9],12,-1958414417),o=h(o,i,n,r,e[u+10],17,-42063),r=h(r,o,i,n,e[u+11],22,-1990404162),n=h(n,r,o,i,e[u+12],7,1804603682),i=h(i,n,r,o,e[u+13],12,-40341101),o=h(o,i,n,r,e[u+14],17,-1502002290),r=h(r,o,i,n,e[u+15],22,1236535329),n=p(n,r,o,i,e[u+1],5,-165796510),i=p(i,n,r,o,e[u+6],9,-1069501632),o=p(o,i,n,r,e[u+11],14,643717713),r=p(r,o,i,n,e[u+0],20,-373897302),n=p(n,r,o,i,e[u+5],5,-701558691),i=p(i,n,r,o,e[u+10],9,38016083),o=p(o,i,n,r,e[u+15],14,-660478335),r=p(r,o,i,n,e[u+4],20,-405537848),n=p(n,r,o,i,e[u+9],5,568446438),i=p(i,n,r,o,e[u+14],9,-1019803690),o=p(o,i,n,r,e[u+3],14,-187363961),r=p(r,o,i,n,e[u+8],20,1163531501),n=p(n,r,o,i,e[u+13],5,-1444681467),i=p(i,n,r,o,e[u+2],9,-51403784),o=p(o,i,n,r,e[u+7],14,1735328473),r=p(r,o,i,n,e[u+12],20,-1926607734),n=g(n,r,o,i,e[u+5],4,-378558),i=g(i,n,r,o,e[u+8],11,-2022574463),o=g(o,i,n,r,e[u+11],16,1839030562),r=g(r,o,i,n,e[u+14],23,-35309556),n=g(n,r,o,i,e[u+1],4,-1530992060),i=g(i,n,r,o,e[u+4],11,1272893353),o=g(o,i,n,r,e[u+7],16,-155497632),r=g(r,o,i,n,e[u+10],23,-1094730640),n=g(n,r,o,i,e[u+13],4,681279174),i=g(i,n,r,o,e[u+0],11,-358537222),o=g(o,i,n,r,e[u+3],16,-722521979),r=g(r,o,i,n,e[u+6],23,76029189),n=g(n,r,o,i,e[u+9],4,-640364487),i=g(i,n,r,o,e[u+12],11,-421815835),o=g(o,i,n,r,e[u+15],16,530742520),r=g(r,o,i,n,e[u+2],23,-995338651),n=y(n,r,o,i,e[u+0],6,-198630844),i=y(i,n,r,o,e[u+7],10,1126891415),o=y(o,i,n,r,e[u+14],15,-1416354905),r=y(r,o,i,n,e[u+5],21,-57434055),n=y(n,r,o,i,e[u+12],6,1700485571),i=y(i,n,r,o,e[u+3],10,-1894986606),o=y(o,i,n,r,e[u+10],15,-1051523),r=y(r,o,i,n,e[u+1],21,-2054922799),n=y(n,r,o,i,e[u+8],6,1873313359),i=y(i,n,r,o,e[u+15],10,-30611744),o=y(o,i,n,r,e[u+6],15,-1560198380),r=y(r,o,i,n,e[u+13],21,1309151649),n=y(n,r,o,i,e[u+4],6,-145523070),i=y(i,n,r,o,e[u+11],10,-1120210379),o=y(o,i,n,r,e[u+2],15,718787259),r=y(r,o,i,n,e[u+9],21,-343485551),n=w(n,a),r=w(r,f),o=w(o,s),i=w(i,c)}return Array(n,r,o,i)}function d(e,t,n,r,o,i){return w(b(w(w(t,e),w(r,i)),o),n)}function h(e,t,n,r,o,i,u){return d(t&n|~t&r,e,t,o,i,u)}function p(e,t,n,r,o,i,u){return d(t&r|n&~r,e,t,o,i,u)}function g(e,t,n,r,o,i,u){return d(t^n^r,e,t,o,i,u)}function y(e,t,n,r,o,i,u){return d(n^(t|~r),e,t,o,i,u)}function w(e,t){var n=(65535&e)+(65535&t),r=(e>>16)+(t>>16)+(n>>16);return r<<16|65535&n}function b(e,t){return e<<t|e>>>32-t}var v=e("./helpers");t.exports=function(e){return v.hash(e,l,16)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],7:[function(e,t,n){(function(e,n,r,o,i,u,a,f,s){!function(){var e,n,r=this;e=function(e){for(var t,t,n=new Array(e),r=0;r<e;r++)0==(3&r)&&(t=4294967296*Math.random()),n[r]=t>>>((3&r)<<3)&255;return n},r.crypto&&crypto.getRandomValues&&(n=function(e){var t=new Uint8Array(e);return crypto.getRandomValues(t),t}),t.exports=n||e}()}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:10}],8:[function(e,t,n){(function(n,r,o,i,u,a,f,s,c){function l(e,t){e[t>>5]|=128<<24-t%32,e[(t+64>>9<<4)+15]=t;for(var n=Array(80),r=1732584193,o=-271733879,i=-1732584194,u=271733878,a=-1009589776,f=0;f<e.length;f+=16){for(var s=r,c=o,l=i,y=u,w=a,b=0;b<80;b++){b<16?n[b]=e[f+b]:n[b]=g(n[b-3]^n[b-8]^n[b-14]^n[b-16],1);var v=p(p(g(r,5),d(b,o,i,u)),p(p(a,n[b]),h(b)));a=u,u=i,i=g(o,30),o=r,r=v}r=p(r,s),o=p(o,c),i=p(i,l),u=p(u,y),a=p(a,w)}return Array(r,o,i,u,a)}function d(e,t,n,r){return e<20?t&n|~t&r:e<40?t^n^r:e<60?t&n|t&r|n&r:t^n^r}function h(e){return e<20?1518500249:e<40?1859775393:e<60?-1894007588:-899497514}function p(e,t){var n=(65535&e)+(65535&t),r=(e>>16)+(t>>16)+(n>>16);return r<<16|65535&n}function g(e,t){return e<<t|e>>>32-t}var y=e("./helpers");t.exports=function(e){return y.hash(e,l,20,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],9:[function(e,t,n){(function(n,r,o,i,u,a,f,s,c){var l=e("./helpers"),d=function(e,t){var n=(65535&e)+(65535&t),r=(e>>16)+(t>>16)+(n>>16);return r<<16|65535&n},h=function(e,t){return e>>>t|e<<32-t},p=function(e,t){return e>>>t},g=function(e,t,n){return e&t^~e&n},y=function(e,t,n){return e&t^e&n^t&n},w=function(e){return h(e,2)^h(e,13)^h(e,22);
4
- },b=function(e){return h(e,6)^h(e,11)^h(e,25)},v=function(e){return h(e,7)^h(e,18)^p(e,3)},m=function(e){return h(e,17)^h(e,19)^p(e,10)},_=function(e,t){var n,r,o,i,u,a,f,s,c,l,h,p,_=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),E=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),I=new Array(64);e[t>>5]|=128<<24-t%32,e[(t+64>>9<<4)+15]=t;for(var c=0;c<e.length;c+=16){n=E[0],r=E[1],o=E[2],i=E[3],u=E[4],a=E[5],f=E[6],s=E[7];for(var l=0;l<64;l++)l<16?I[l]=e[l+c]:I[l]=d(d(d(m(I[l-2]),I[l-7]),v(I[l-15])),I[l-16]),h=d(d(d(d(s,b(u)),g(u,a,f)),_[l]),I[l]),p=d(w(n),y(n,r,o)),s=f,f=a,a=u,u=d(i,h),i=o,o=r,r=n,n=d(h,p);E[0]=d(n,E[0]),E[1]=d(r,E[1]),E[2]=d(o,E[2]),E[3]=d(i,E[3]),E[4]=d(u,E[4]),E[5]=d(a,E[5]),E[6]=d(f,E[6]),E[7]=d(s,E[7])}return E};t.exports=function(e){return l.hash(e,_,32,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],10:[function(e,t,n){(function(e,n,r,o,i,u,a,f,s){function c(){}var e=t.exports={};e.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var n=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(e){n.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),e.title="browser",e.browser=!0,e.env={},e.argv=[],e.on=c,e.addListener=c,e.once=c,e.off=c,e.removeListener=c,e.removeAllListeners=c,e.emit=c,e.binding=function(e){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(e){throw new Error("process.chdir is not supported")}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:10}],11:[function(e,t,n){(function(e,t,r,o,i,u,a,f,s){n.read=function(e,t,n,r,o){var i,u,a=8*o-r-1,f=(1<<a)-1,s=f>>1,c=-7,l=n?o-1:0,d=n?-1:1,h=e[t+l];for(l+=d,i=h&(1<<-c)-1,h>>=-c,c+=a;c>0;i=256*i+e[t+l],l+=d,c-=8);for(u=i&(1<<-c)-1,i>>=-c,c+=r;c>0;u=256*u+e[t+l],l+=d,c-=8);if(0===i)i=1-s;else{if(i===f)return u?NaN:(h?-1:1)*(1/0);u+=Math.pow(2,r),i-=s}return(h?-1:1)*u*Math.pow(2,i-r)},n.write=function(e,t,n,r,o,i){var u,a,f,s=8*i-o-1,c=(1<<s)-1,l=c>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,u=c):(u=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-u))<1&&(u--,f*=2),t+=u+l>=1?d/f:d*Math.pow(2,1-l),t*f>=2&&(u++,f/=2),u+l>=c?(a=0,u=c):u+l>=1?(a=(t*f-1)*Math.pow(2,o),u+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,o),u=0));o>=8;e[n+h]=255&a,h+=p,a/=256,o-=8);for(u=u<<o|a,s+=o;s>0;e[n+h]=255&u,h+=p,u/=256,s-=8);e[n+h-p]|=128*g}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/ieee754/index.js","/node_modules/ieee754")},{buffer:3,lYpoI2:10}]},{},[1])(1)});
5
- }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
6
- },{}],2:[function(require,module,exports){
7
- // http://wiki.commonjs.org/wiki/Unit_Testing/1.0
8
- //
9
- // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
10
- //
11
- // Originally from narwhal.js (http://narwhaljs.org)
12
- // Copyright (c) 2009 Thomas Robinson <280north.com>
13
- //
14
- // Permission is hereby granted, free of charge, to any person obtaining a copy
15
- // of this software and associated documentation files (the 'Software'), to
16
- // deal in the Software without restriction, including without limitation the
17
- // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18
- // sell copies of the Software, and to permit persons to whom the Software is
19
- // furnished to do so, subject to the following conditions:
20
- //
21
- // The above copyright notice and this permission notice shall be included in
22
- // all copies or substantial portions of the Software.
23
- //
24
- // THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
- // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28
- // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29
- // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30
-
31
- // when used in node, this will actually load the util module we depend on
32
- // versus loading the builtin util module as happens otherwise
33
- // this is a bug in node module loading as far as I am concerned
34
- var util = require('util/');
35
-
36
- var pSlice = Array.prototype.slice;
37
- var hasOwn = Object.prototype.hasOwnProperty;
38
-
39
- // 1. The assert module provides functions that throw
40
- // AssertionError's when particular conditions are not met. The
41
- // assert module must conform to the following interface.
42
-
43
- var assert = module.exports = ok;
44
-
45
- // 2. The AssertionError is defined in assert.
46
- // new assert.AssertionError({ message: message,
47
- // actual: actual,
48
- // expected: expected })
49
-
50
- assert.AssertionError = function AssertionError(options) {
51
- this.name = 'AssertionError';
52
- this.actual = options.actual;
53
- this.expected = options.expected;
54
- this.operator = options.operator;
55
- if (options.message) {
56
- this.message = options.message;
57
- this.generatedMessage = false;
58
- } else {
59
- this.message = getMessage(this);
60
- this.generatedMessage = true;
61
- }
62
- var stackStartFunction = options.stackStartFunction || fail;
63
-
64
- if (Error.captureStackTrace) {
65
- Error.captureStackTrace(this, stackStartFunction);
66
- }
67
- else {
68
- // non v8 browsers so we can have a stacktrace
69
- var err = new Error();
70
- if (err.stack) {
71
- var out = err.stack;
72
-
73
- // try to strip useless frames
74
- var fn_name = stackStartFunction.name;
75
- var idx = out.indexOf('\n' + fn_name);
76
- if (idx >= 0) {
77
- // once we have located the function frame
78
- // we need to strip out everything before it (and its line)
79
- var next_line = out.indexOf('\n', idx + 1);
80
- out = out.substring(next_line + 1);
81
- }
82
-
83
- this.stack = out;
84
- }
85
- }
86
- };
87
-
88
- // assert.AssertionError instanceof Error
89
- util.inherits(assert.AssertionError, Error);
90
-
91
- function replacer(key, value) {
92
- if (util.isUndefined(value)) {
93
- return '' + value;
94
- }
95
- if (util.isNumber(value) && (isNaN(value) || !isFinite(value))) {
96
- return value.toString();
97
- }
98
- if (util.isFunction(value) || util.isRegExp(value)) {
99
- return value.toString();
100
- }
101
- return value;
102
- }
103
-
104
- function truncate(s, n) {
105
- if (util.isString(s)) {
106
- return s.length < n ? s : s.slice(0, n);
107
- } else {
108
- return s;
109
- }
110
- }
111
-
112
- function getMessage(self) {
113
- return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' +
114
- self.operator + ' ' +
115
- truncate(JSON.stringify(self.expected, replacer), 128);
116
- }
117
-
118
- // At present only the three keys mentioned above are used and
119
- // understood by the spec. Implementations or sub modules can pass
120
- // other keys to the AssertionError's constructor - they will be
121
- // ignored.
122
-
123
- // 3. All of the following functions must throw an AssertionError
124
- // when a corresponding condition is not met, with a message that
125
- // may be undefined if not provided. All assertion methods provide
126
- // both the actual and expected values to the assertion error for
127
- // display purposes.
128
-
129
- function fail(actual, expected, message, operator, stackStartFunction) {
130
- throw new assert.AssertionError({
131
- message: message,
132
- actual: actual,
133
- expected: expected,
134
- operator: operator,
135
- stackStartFunction: stackStartFunction
136
- });
137
- }
138
-
139
- // EXTENSION! allows for well behaved errors defined elsewhere.
140
- assert.fail = fail;
141
-
142
- // 4. Pure assertion tests whether a value is truthy, as determined
143
- // by !!guard.
144
- // assert.ok(guard, message_opt);
145
- // This statement is equivalent to assert.equal(true, !!guard,
146
- // message_opt);. To test strictly for the value true, use
147
- // assert.strictEqual(true, guard, message_opt);.
148
-
149
- function ok(value, message) {
150
- if (!value) fail(value, true, message, '==', assert.ok);
151
- }
152
- assert.ok = ok;
153
-
154
- // 5. The equality assertion tests shallow, coercive equality with
155
- // ==.
156
- // assert.equal(actual, expected, message_opt);
157
-
158
- assert.equal = function equal(actual, expected, message) {
159
- if (actual != expected) fail(actual, expected, message, '==', assert.equal);
160
- };
161
-
162
- // 6. The non-equality assertion tests for whether two objects are not equal
163
- // with != assert.notEqual(actual, expected, message_opt);
164
-
165
- assert.notEqual = function notEqual(actual, expected, message) {
166
- if (actual == expected) {
167
- fail(actual, expected, message, '!=', assert.notEqual);
168
- }
169
- };
170
-
171
- // 7. The equivalence assertion tests a deep equality relation.
172
- // assert.deepEqual(actual, expected, message_opt);
173
-
174
- assert.deepEqual = function deepEqual(actual, expected, message) {
175
- if (!_deepEqual(actual, expected)) {
176
- fail(actual, expected, message, 'deepEqual', assert.deepEqual);
177
- }
178
- };
179
-
180
- function _deepEqual(actual, expected) {
181
- // 7.1. All identical values are equivalent, as determined by ===.
182
- if (actual === expected) {
183
- return true;
184
-
185
- } else if (util.isBuffer(actual) && util.isBuffer(expected)) {
186
- if (actual.length != expected.length) return false;
187
-
188
- for (var i = 0; i < actual.length; i++) {
189
- if (actual[i] !== expected[i]) return false;
190
- }
191
-
192
- return true;
193
-
194
- // 7.2. If the expected value is a Date object, the actual value is
195
- // equivalent if it is also a Date object that refers to the same time.
196
- } else if (util.isDate(actual) && util.isDate(expected)) {
197
- return actual.getTime() === expected.getTime();
198
-
199
- // 7.3 If the expected value is a RegExp object, the actual value is
200
- // equivalent if it is also a RegExp object with the same source and
201
- // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
202
- } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
203
- return actual.source === expected.source &&
204
- actual.global === expected.global &&
205
- actual.multiline === expected.multiline &&
206
- actual.lastIndex === expected.lastIndex &&
207
- actual.ignoreCase === expected.ignoreCase;
208
-
209
- // 7.4. Other pairs that do not both pass typeof value == 'object',
210
- // equivalence is determined by ==.
211
- } else if (!util.isObject(actual) && !util.isObject(expected)) {
212
- return actual == expected;
213
-
214
- // 7.5 For all other Object pairs, including Array objects, equivalence is
215
- // determined by having the same number of owned properties (as verified
216
- // with Object.prototype.hasOwnProperty.call), the same set of keys
217
- // (although not necessarily the same order), equivalent values for every
218
- // corresponding key, and an identical 'prototype' property. Note: this
219
- // accounts for both named and indexed properties on Arrays.
220
- } else {
221
- return objEquiv(actual, expected);
222
- }
223
- }
224
-
225
- function isArguments(object) {
226
- return Object.prototype.toString.call(object) == '[object Arguments]';
227
- }
228
-
229
- function objEquiv(a, b) {
230
- if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b))
231
- return false;
232
- // an identical 'prototype' property.
233
- if (a.prototype !== b.prototype) return false;
234
- //~~~I've managed to break Object.keys through screwy arguments passing.
235
- // Converting to array solves the problem.
236
- if (isArguments(a)) {
237
- if (!isArguments(b)) {
238
- return false;
239
- }
240
- a = pSlice.call(a);
241
- b = pSlice.call(b);
242
- return _deepEqual(a, b);
243
- }
244
- try {
245
- var ka = objectKeys(a),
246
- kb = objectKeys(b),
247
- key, i;
248
- } catch (e) {//happens when one is a string literal and the other isn't
249
- return false;
250
- }
251
- // having the same number of owned properties (keys incorporates
252
- // hasOwnProperty)
253
- if (ka.length != kb.length)
254
- return false;
255
- //the same set of keys (although not necessarily the same order),
256
- ka.sort();
257
- kb.sort();
258
- //~~~cheap key test
259
- for (i = ka.length - 1; i >= 0; i--) {
260
- if (ka[i] != kb[i])
261
- return false;
262
- }
263
- //equivalent values for every corresponding key, and
264
- //~~~possibly expensive deep test
265
- for (i = ka.length - 1; i >= 0; i--) {
266
- key = ka[i];
267
- if (!_deepEqual(a[key], b[key])) return false;
268
- }
269
- return true;
270
- }
271
-
272
- // 8. The non-equivalence assertion tests for any deep inequality.
273
- // assert.notDeepEqual(actual, expected, message_opt);
274
-
275
- assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
276
- if (_deepEqual(actual, expected)) {
277
- fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
278
- }
279
- };
280
-
281
- // 9. The strict equality assertion tests strict equality, as determined by ===.
282
- // assert.strictEqual(actual, expected, message_opt);
283
-
284
- assert.strictEqual = function strictEqual(actual, expected, message) {
285
- if (actual !== expected) {
286
- fail(actual, expected, message, '===', assert.strictEqual);
287
- }
288
- };
289
-
290
- // 10. The strict non-equality assertion tests for strict inequality, as
291
- // determined by !==. assert.notStrictEqual(actual, expected, message_opt);
292
-
293
- assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
294
- if (actual === expected) {
295
- fail(actual, expected, message, '!==', assert.notStrictEqual);
296
- }
297
- };
298
-
299
- function expectedException(actual, expected) {
300
- if (!actual || !expected) {
301
- return false;
302
- }
303
-
304
- if (Object.prototype.toString.call(expected) == '[object RegExp]') {
305
- return expected.test(actual);
306
- } else if (actual instanceof expected) {
307
- return true;
308
- } else if (expected.call({}, actual) === true) {
309
- return true;
310
- }
311
-
312
- return false;
313
- }
314
-
315
- function _throws(shouldThrow, block, expected, message) {
316
- var actual;
317
-
318
- if (util.isString(expected)) {
319
- message = expected;
320
- expected = null;
321
- }
322
-
323
- try {
324
- block();
325
- } catch (e) {
326
- actual = e;
327
- }
328
-
329
- message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
330
- (message ? ' ' + message : '.');
331
-
332
- if (shouldThrow && !actual) {
333
- fail(actual, expected, 'Missing expected exception' + message);
334
- }
335
-
336
- if (!shouldThrow && expectedException(actual, expected)) {
337
- fail(actual, expected, 'Got unwanted exception' + message);
338
- }
339
-
340
- if ((shouldThrow && actual && expected &&
341
- !expectedException(actual, expected)) || (!shouldThrow && actual)) {
342
- throw actual;
343
- }
344
- }
345
-
346
- // 11. Expected to throw an error:
347
- // assert.throws(block, Error_opt, message_opt);
348
-
349
- assert.throws = function(block, /*optional*/error, /*optional*/message) {
350
- _throws.apply(this, [true].concat(pSlice.call(arguments)));
351
- };
352
-
353
- // EXTENSION! This is annoying to write outside this module.
354
- assert.doesNotThrow = function(block, /*optional*/message) {
355
- _throws.apply(this, [false].concat(pSlice.call(arguments)));
356
- };
357
-
358
- assert.ifError = function(err) { if (err) {throw err;}};
359
-
360
- var objectKeys = Object.keys || function (obj) {
361
- var keys = [];
362
- for (var key in obj) {
363
- if (hasOwn.call(obj, key)) keys.push(key);
364
- }
365
- return keys;
366
- };
367
-
368
- },{"util/":5}],3:[function(require,module,exports){
369
- if (typeof Object.create === 'function') {
370
- // implementation from standard node.js 'util' module
371
- module.exports = function inherits(ctor, superCtor) {
372
- ctor.super_ = superCtor
373
- ctor.prototype = Object.create(superCtor.prototype, {
374
- constructor: {
375
- value: ctor,
376
- enumerable: false,
377
- writable: true,
378
- configurable: true
379
- }
380
- });
381
- };
382
- } else {
383
- // old school shim for old browsers
384
- module.exports = function inherits(ctor, superCtor) {
385
- ctor.super_ = superCtor
386
- var TempCtor = function () {}
387
- TempCtor.prototype = superCtor.prototype
388
- ctor.prototype = new TempCtor()
389
- ctor.prototype.constructor = ctor
390
- }
391
- }
392
-
393
- },{}],4:[function(require,module,exports){
394
- module.exports = function isBuffer(arg) {
395
- return arg && typeof arg === 'object'
396
- && typeof arg.copy === 'function'
397
- && typeof arg.fill === 'function'
398
- && typeof arg.readUInt8 === 'function';
399
- }
400
- },{}],5:[function(require,module,exports){
401
- (function (process,global){
402
- // Copyright Joyent, Inc. and other Node contributors.
403
- //
404
- // Permission is hereby granted, free of charge, to any person obtaining a
405
- // copy of this software and associated documentation files (the
406
- // "Software"), to deal in the Software without restriction, including
407
- // without limitation the rights to use, copy, modify, merge, publish,
408
- // distribute, sublicense, and/or sell copies of the Software, and to permit
409
- // persons to whom the Software is furnished to do so, subject to the
410
- // following conditions:
411
- //
412
- // The above copyright notice and this permission notice shall be included
413
- // in all copies or substantial portions of the Software.
414
- //
415
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
416
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
417
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
418
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
419
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
420
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
421
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
422
-
423
- var formatRegExp = /%[sdj%]/g;
424
- exports.format = function(f) {
425
- if (!isString(f)) {
426
- var objects = [];
427
- for (var i = 0; i < arguments.length; i++) {
428
- objects.push(inspect(arguments[i]));
429
- }
430
- return objects.join(' ');
431
- }
432
-
433
- var i = 1;
434
- var args = arguments;
435
- var len = args.length;
436
- var str = String(f).replace(formatRegExp, function(x) {
437
- if (x === '%%') return '%';
438
- if (i >= len) return x;
439
- switch (x) {
440
- case '%s': return String(args[i++]);
441
- case '%d': return Number(args[i++]);
442
- case '%j':
443
- try {
444
- return JSON.stringify(args[i++]);
445
- } catch (_) {
446
- return '[Circular]';
447
- }
448
- default:
449
- return x;
450
- }
451
- });
452
- for (var x = args[i]; i < len; x = args[++i]) {
453
- if (isNull(x) || !isObject(x)) {
454
- str += ' ' + x;
455
- } else {
456
- str += ' ' + inspect(x);
457
- }
458
- }
459
- return str;
460
- };
461
-
462
-
463
- // Mark that a method should not be used.
464
- // Returns a modified function which warns once by default.
465
- // If --no-deprecation is set, then it is a no-op.
466
- exports.deprecate = function(fn, msg) {
467
- // Allow for deprecating things in the process of starting up.
468
- if (isUndefined(global.process)) {
469
- return function() {
470
- return exports.deprecate(fn, msg).apply(this, arguments);
471
- };
472
- }
473
-
474
- if (process.noDeprecation === true) {
475
- return fn;
476
- }
477
-
478
- var warned = false;
479
- function deprecated() {
480
- if (!warned) {
481
- if (process.throwDeprecation) {
482
- throw new Error(msg);
483
- } else if (process.traceDeprecation) {
484
- console.trace(msg);
485
- } else {
486
- console.error(msg);
487
- }
488
- warned = true;
489
- }
490
- return fn.apply(this, arguments);
491
- }
492
-
493
- return deprecated;
494
- };
495
-
496
-
497
- var debugs = {};
498
- var debugEnviron;
499
- exports.debuglog = function(set) {
500
- if (isUndefined(debugEnviron))
501
- debugEnviron = process.env.NODE_DEBUG || '';
502
- set = set.toUpperCase();
503
- if (!debugs[set]) {
504
- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
505
- var pid = process.pid;
506
- debugs[set] = function() {
507
- var msg = exports.format.apply(exports, arguments);
508
- console.error('%s %d: %s', set, pid, msg);
509
- };
510
- } else {
511
- debugs[set] = function() {};
512
- }
513
- }
514
- return debugs[set];
515
- };
516
-
517
-
518
- /**
519
- * Echos the value of a value. Trys to print the value out
520
- * in the best way possible given the different types.
521
- *
522
- * @param {Object} obj The object to print out.
523
- * @param {Object} opts Optional options object that alters the output.
524
- */
525
- /* legacy: obj, showHidden, depth, colors*/
526
- function inspect(obj, opts) {
527
- // default options
528
- var ctx = {
529
- seen: [],
530
- stylize: stylizeNoColor
531
- };
532
- // legacy...
533
- if (arguments.length >= 3) ctx.depth = arguments[2];
534
- if (arguments.length >= 4) ctx.colors = arguments[3];
535
- if (isBoolean(opts)) {
536
- // legacy...
537
- ctx.showHidden = opts;
538
- } else if (opts) {
539
- // got an "options" object
540
- exports._extend(ctx, opts);
541
- }
542
- // set default options
543
- if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
544
- if (isUndefined(ctx.depth)) ctx.depth = 2;
545
- if (isUndefined(ctx.colors)) ctx.colors = false;
546
- if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
547
- if (ctx.colors) ctx.stylize = stylizeWithColor;
548
- return formatValue(ctx, obj, ctx.depth);
549
- }
550
- exports.inspect = inspect;
551
-
552
-
553
- // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
554
- inspect.colors = {
555
- 'bold' : [1, 22],
556
- 'italic' : [3, 23],
557
- 'underline' : [4, 24],
558
- 'inverse' : [7, 27],
559
- 'white' : [37, 39],
560
- 'grey' : [90, 39],
561
- 'black' : [30, 39],
562
- 'blue' : [34, 39],
563
- 'cyan' : [36, 39],
564
- 'green' : [32, 39],
565
- 'magenta' : [35, 39],
566
- 'red' : [31, 39],
567
- 'yellow' : [33, 39]
568
- };
569
-
570
- // Don't use 'blue' not visible on cmd.exe
571
- inspect.styles = {
572
- 'special': 'cyan',
573
- 'number': 'yellow',
574
- 'boolean': 'yellow',
575
- 'undefined': 'grey',
576
- 'null': 'bold',
577
- 'string': 'green',
578
- 'date': 'magenta',
579
- // "name": intentionally not styling
580
- 'regexp': 'red'
581
- };
582
-
583
-
584
- function stylizeWithColor(str, styleType) {
585
- var style = inspect.styles[styleType];
586
-
587
- if (style) {
588
- return '\u001b[' + inspect.colors[style][0] + 'm' + str +
589
- '\u001b[' + inspect.colors[style][1] + 'm';
590
- } else {
591
- return str;
592
- }
593
- }
594
-
595
-
596
- function stylizeNoColor(str, styleType) {
597
- return str;
598
- }
599
-
600
-
601
- function arrayToHash(array) {
602
- var hash = {};
603
-
604
- array.forEach(function(val, idx) {
605
- hash[val] = true;
606
- });
607
-
608
- return hash;
609
- }
610
-
611
-
612
- function formatValue(ctx, value, recurseTimes) {
613
- // Provide a hook for user-specified inspect functions.
614
- // Check that value is an object with an inspect function on it
615
- if (ctx.customInspect &&
616
- value &&
617
- isFunction(value.inspect) &&
618
- // Filter out the util module, it's inspect function is special
619
- value.inspect !== exports.inspect &&
620
- // Also filter out any prototype objects using the circular check.
621
- !(value.constructor && value.constructor.prototype === value)) {
622
- var ret = value.inspect(recurseTimes, ctx);
623
- if (!isString(ret)) {
624
- ret = formatValue(ctx, ret, recurseTimes);
625
- }
626
- return ret;
627
- }
628
-
629
- // Primitive types cannot have properties
630
- var primitive = formatPrimitive(ctx, value);
631
- if (primitive) {
632
- return primitive;
633
- }
634
-
635
- // Look up the keys of the object.
636
- var keys = Object.keys(value);
637
- var visibleKeys = arrayToHash(keys);
638
-
639
- if (ctx.showHidden) {
640
- keys = Object.getOwnPropertyNames(value);
641
- }
642
-
643
- // IE doesn't make error fields non-enumerable
644
- // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
645
- if (isError(value)
646
- && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
647
- return formatError(value);
648
- }
649
-
650
- // Some type of object without properties can be shortcutted.
651
- if (keys.length === 0) {
652
- if (isFunction(value)) {
653
- var name = value.name ? ': ' + value.name : '';
654
- return ctx.stylize('[Function' + name + ']', 'special');
655
- }
656
- if (isRegExp(value)) {
657
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
658
- }
659
- if (isDate(value)) {
660
- return ctx.stylize(Date.prototype.toString.call(value), 'date');
661
- }
662
- if (isError(value)) {
663
- return formatError(value);
664
- }
665
- }
666
-
667
- var base = '', array = false, braces = ['{', '}'];
668
-
669
- // Make Array say that they are Array
670
- if (isArray(value)) {
671
- array = true;
672
- braces = ['[', ']'];
673
- }
674
-
675
- // Make functions say that they are functions
676
- if (isFunction(value)) {
677
- var n = value.name ? ': ' + value.name : '';
678
- base = ' [Function' + n + ']';
679
- }
680
-
681
- // Make RegExps say that they are RegExps
682
- if (isRegExp(value)) {
683
- base = ' ' + RegExp.prototype.toString.call(value);
684
- }
685
-
686
- // Make dates with properties first say the date
687
- if (isDate(value)) {
688
- base = ' ' + Date.prototype.toUTCString.call(value);
689
- }
690
-
691
- // Make error with message first say the error
692
- if (isError(value)) {
693
- base = ' ' + formatError(value);
694
- }
695
-
696
- if (keys.length === 0 && (!array || value.length == 0)) {
697
- return braces[0] + base + braces[1];
698
- }
699
-
700
- if (recurseTimes < 0) {
701
- if (isRegExp(value)) {
702
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
703
- } else {
704
- return ctx.stylize('[Object]', 'special');
705
- }
706
- }
707
-
708
- ctx.seen.push(value);
709
-
710
- var output;
711
- if (array) {
712
- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
713
- } else {
714
- output = keys.map(function(key) {
715
- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
716
- });
717
- }
718
-
719
- ctx.seen.pop();
720
-
721
- return reduceToSingleString(output, base, braces);
722
- }
723
-
724
-
725
- function formatPrimitive(ctx, value) {
726
- if (isUndefined(value))
727
- return ctx.stylize('undefined', 'undefined');
728
- if (isString(value)) {
729
- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
730
- .replace(/'/g, "\\'")
731
- .replace(/\\"/g, '"') + '\'';
732
- return ctx.stylize(simple, 'string');
733
- }
734
- if (isNumber(value))
735
- return ctx.stylize('' + value, 'number');
736
- if (isBoolean(value))
737
- return ctx.stylize('' + value, 'boolean');
738
- // For some reason typeof null is "object", so special case here.
739
- if (isNull(value))
740
- return ctx.stylize('null', 'null');
741
- }
742
-
743
-
744
- function formatError(value) {
745
- return '[' + Error.prototype.toString.call(value) + ']';
746
- }
747
-
748
-
749
- function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
750
- var output = [];
751
- for (var i = 0, l = value.length; i < l; ++i) {
752
- if (hasOwnProperty(value, String(i))) {
753
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
754
- String(i), true));
755
- } else {
756
- output.push('');
757
- }
758
- }
759
- keys.forEach(function(key) {
760
- if (!key.match(/^\d+$/)) {
761
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
762
- key, true));
763
- }
764
- });
765
- return output;
766
- }
767
-
768
-
769
- function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
770
- var name, str, desc;
771
- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
772
- if (desc.get) {
773
- if (desc.set) {
774
- str = ctx.stylize('[Getter/Setter]', 'special');
775
- } else {
776
- str = ctx.stylize('[Getter]', 'special');
777
- }
778
- } else {
779
- if (desc.set) {
780
- str = ctx.stylize('[Setter]', 'special');
781
- }
782
- }
783
- if (!hasOwnProperty(visibleKeys, key)) {
784
- name = '[' + key + ']';
785
- }
786
- if (!str) {
787
- if (ctx.seen.indexOf(desc.value) < 0) {
788
- if (isNull(recurseTimes)) {
789
- str = formatValue(ctx, desc.value, null);
790
- } else {
791
- str = formatValue(ctx, desc.value, recurseTimes - 1);
792
- }
793
- if (str.indexOf('\n') > -1) {
794
- if (array) {
795
- str = str.split('\n').map(function(line) {
796
- return ' ' + line;
797
- }).join('\n').substr(2);
798
- } else {
799
- str = '\n' + str.split('\n').map(function(line) {
800
- return ' ' + line;
801
- }).join('\n');
802
- }
803
- }
804
- } else {
805
- str = ctx.stylize('[Circular]', 'special');
806
- }
807
- }
808
- if (isUndefined(name)) {
809
- if (array && key.match(/^\d+$/)) {
810
- return str;
811
- }
812
- name = JSON.stringify('' + key);
813
- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
814
- name = name.substr(1, name.length - 2);
815
- name = ctx.stylize(name, 'name');
816
- } else {
817
- name = name.replace(/'/g, "\\'")
818
- .replace(/\\"/g, '"')
819
- .replace(/(^"|"$)/g, "'");
820
- name = ctx.stylize(name, 'string');
821
- }
822
- }
823
-
824
- return name + ': ' + str;
825
- }
826
-
827
-
828
- function reduceToSingleString(output, base, braces) {
829
- var numLinesEst = 0;
830
- var length = output.reduce(function(prev, cur) {
831
- numLinesEst++;
832
- if (cur.indexOf('\n') >= 0) numLinesEst++;
833
- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
834
- }, 0);
835
-
836
- if (length > 60) {
837
- return braces[0] +
838
- (base === '' ? '' : base + '\n ') +
839
- ' ' +
840
- output.join(',\n ') +
841
- ' ' +
842
- braces[1];
843
- }
844
-
845
- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
846
- }
847
-
848
-
849
- // NOTE: These type checking functions intentionally don't use `instanceof`
850
- // because it is fragile and can be easily faked with `Object.create()`.
851
- function isArray(ar) {
852
- return Array.isArray(ar);
853
- }
854
- exports.isArray = isArray;
855
-
856
- function isBoolean(arg) {
857
- return typeof arg === 'boolean';
858
- }
859
- exports.isBoolean = isBoolean;
860
-
861
- function isNull(arg) {
862
- return arg === null;
863
- }
864
- exports.isNull = isNull;
865
-
866
- function isNullOrUndefined(arg) {
867
- return arg == null;
868
- }
869
- exports.isNullOrUndefined = isNullOrUndefined;
870
-
871
- function isNumber(arg) {
872
- return typeof arg === 'number';
873
- }
874
- exports.isNumber = isNumber;
875
-
876
- function isString(arg) {
877
- return typeof arg === 'string';
878
- }
879
- exports.isString = isString;
880
-
881
- function isSymbol(arg) {
882
- return typeof arg === 'symbol';
883
- }
884
- exports.isSymbol = isSymbol;
885
-
886
- function isUndefined(arg) {
887
- return arg === void 0;
888
- }
889
- exports.isUndefined = isUndefined;
890
-
891
- function isRegExp(re) {
892
- return isObject(re) && objectToString(re) === '[object RegExp]';
893
- }
894
- exports.isRegExp = isRegExp;
895
-
896
- function isObject(arg) {
897
- return typeof arg === 'object' && arg !== null;
898
- }
899
- exports.isObject = isObject;
900
-
901
- function isDate(d) {
902
- return isObject(d) && objectToString(d) === '[object Date]';
903
- }
904
- exports.isDate = isDate;
905
-
906
- function isError(e) {
907
- return isObject(e) &&
908
- (objectToString(e) === '[object Error]' || e instanceof Error);
909
- }
910
- exports.isError = isError;
911
-
912
- function isFunction(arg) {
913
- return typeof arg === 'function';
914
- }
915
- exports.isFunction = isFunction;
916
-
917
- function isPrimitive(arg) {
918
- return arg === null ||
919
- typeof arg === 'boolean' ||
920
- typeof arg === 'number' ||
921
- typeof arg === 'string' ||
922
- typeof arg === 'symbol' || // ES6 symbol
923
- typeof arg === 'undefined';
924
- }
925
- exports.isPrimitive = isPrimitive;
926
-
927
- exports.isBuffer = require('./support/isBuffer');
928
-
929
- function objectToString(o) {
930
- return Object.prototype.toString.call(o);
931
- }
932
-
933
-
934
- function pad(n) {
935
- return n < 10 ? '0' + n.toString(10) : n.toString(10);
936
- }
937
-
938
-
939
- var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
940
- 'Oct', 'Nov', 'Dec'];
941
-
942
- // 26 Feb 16:19:34
943
- function timestamp() {
944
- var d = new Date();
945
- var time = [pad(d.getHours()),
946
- pad(d.getMinutes()),
947
- pad(d.getSeconds())].join(':');
948
- return [d.getDate(), months[d.getMonth()], time].join(' ');
949
- }
950
-
951
-
952
- // log is just a thin wrapper to console.log that prepends a timestamp
953
- exports.log = function() {
954
- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
955
- };
956
-
957
-
958
- /**
959
- * Inherit the prototype methods from one constructor into another.
960
- *
961
- * The Function.prototype.inherits from lang.js rewritten as a standalone
962
- * function (not on Function.prototype). NOTE: If this file is to be loaded
963
- * during bootstrapping this function needs to be rewritten using some native
964
- * functions as prototype setup using normal JavaScript does not work as
965
- * expected during bootstrapping (see mirror.js in r114903).
966
- *
967
- * @param {function} ctor Constructor function which needs to inherit the
968
- * prototype.
969
- * @param {function} superCtor Constructor function to inherit prototype from.
970
- */
971
- exports.inherits = require('inherits');
972
-
973
- exports._extend = function(origin, add) {
974
- // Don't do anything if add isn't an object
975
- if (!add || !isObject(add)) return origin;
976
-
977
- var keys = Object.keys(add);
978
- var i = keys.length;
979
- while (i--) {
980
- origin[keys[i]] = add[keys[i]];
981
- }
982
- return origin;
983
- };
984
-
985
- function hasOwnProperty(obj, prop) {
986
- return Object.prototype.hasOwnProperty.call(obj, prop);
987
- }
988
-
989
- }).call(this,require("7YKIPe"),typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
990
- },{"./support/isBuffer":4,"7YKIPe":9,"inherits":3}],6:[function(require,module,exports){
991
- var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
992
-
993
- ;(function (exports) {
994
- 'use strict';
995
-
996
- var Arr = (typeof Uint8Array !== 'undefined')
997
- ? Uint8Array
998
- : Array
999
-
1000
- var PLUS = '+'.charCodeAt(0)
1001
- var SLASH = '/'.charCodeAt(0)
1002
- var NUMBER = '0'.charCodeAt(0)
1003
- var LOWER = 'a'.charCodeAt(0)
1004
- var UPPER = 'A'.charCodeAt(0)
1005
- var PLUS_URL_SAFE = '-'.charCodeAt(0)
1006
- var SLASH_URL_SAFE = '_'.charCodeAt(0)
1007
-
1008
- function decode (elt) {
1009
- var code = elt.charCodeAt(0)
1010
- if (code === PLUS ||
1011
- code === PLUS_URL_SAFE)
1012
- return 62 // '+'
1013
- if (code === SLASH ||
1014
- code === SLASH_URL_SAFE)
1015
- return 63 // '/'
1016
- if (code < NUMBER)
1017
- return -1 //no match
1018
- if (code < NUMBER + 10)
1019
- return code - NUMBER + 26 + 26
1020
- if (code < UPPER + 26)
1021
- return code - UPPER
1022
- if (code < LOWER + 26)
1023
- return code - LOWER + 26
1024
- }
1025
-
1026
- function b64ToByteArray (b64) {
1027
- var i, j, l, tmp, placeHolders, arr
1028
-
1029
- if (b64.length % 4 > 0) {
1030
- throw new Error('Invalid string. Length must be a multiple of 4')
1031
- }
1032
-
1033
- // the number of equal signs (place holders)
1034
- // if there are two placeholders, than the two characters before it
1035
- // represent one byte
1036
- // if there is only one, then the three characters before it represent 2 bytes
1037
- // this is just a cheap hack to not do indexOf twice
1038
- var len = b64.length
1039
- placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0
1040
-
1041
- // base64 is 4/3 + up to two characters of the original data
1042
- arr = new Arr(b64.length * 3 / 4 - placeHolders)
1043
-
1044
- // if there are placeholders, only get up to the last complete 4 chars
1045
- l = placeHolders > 0 ? b64.length - 4 : b64.length
1046
-
1047
- var L = 0
1048
-
1049
- function push (v) {
1050
- arr[L++] = v
1051
- }
1052
-
1053
- for (i = 0, j = 0; i < l; i += 4, j += 3) {
1054
- tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3))
1055
- push((tmp & 0xFF0000) >> 16)
1056
- push((tmp & 0xFF00) >> 8)
1057
- push(tmp & 0xFF)
1058
- }
1059
-
1060
- if (placeHolders === 2) {
1061
- tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4)
1062
- push(tmp & 0xFF)
1063
- } else if (placeHolders === 1) {
1064
- tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2)
1065
- push((tmp >> 8) & 0xFF)
1066
- push(tmp & 0xFF)
1067
- }
1068
-
1069
- return arr
1070
- }
1071
-
1072
- function uint8ToBase64 (uint8) {
1073
- var i,
1074
- extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
1075
- output = "",
1076
- temp, length
1077
-
1078
- function encode (num) {
1079
- return lookup.charAt(num)
1080
- }
1081
-
1082
- function tripletToBase64 (num) {
1083
- return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F)
1084
- }
1085
-
1086
- // go through the array every three bytes, we'll deal with trailing stuff later
1087
- for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
1088
- temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
1089
- output += tripletToBase64(temp)
1090
- }
1091
-
1092
- // pad the end with zeros, but make sure to not forget the extra bytes
1093
- switch (extraBytes) {
1094
- case 1:
1095
- temp = uint8[uint8.length - 1]
1096
- output += encode(temp >> 2)
1097
- output += encode((temp << 4) & 0x3F)
1098
- output += '=='
1099
- break
1100
- case 2:
1101
- temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1])
1102
- output += encode(temp >> 10)
1103
- output += encode((temp >> 4) & 0x3F)
1104
- output += encode((temp << 2) & 0x3F)
1105
- output += '='
1106
- break
1107
- }
1108
-
1109
- return output
1110
- }
1111
-
1112
- exports.toByteArray = b64ToByteArray
1113
- exports.fromByteArray = uint8ToBase64
1114
- }(typeof exports === 'undefined' ? (this.base64js = {}) : exports))
1115
-
1116
- },{}],7:[function(require,module,exports){
1117
- /*!
1118
- * The buffer module from node.js, for the browser.
1119
- *
1120
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
1121
- * @license MIT
1122
- */
1123
-
1124
- var base64 = require('base64-js')
1125
- var ieee754 = require('ieee754')
1126
-
1127
- exports.Buffer = Buffer
1128
- exports.SlowBuffer = Buffer
1129
- exports.INSPECT_MAX_BYTES = 50
1130
- Buffer.poolSize = 8192
1131
-
1132
- /**
1133
- * If `Buffer._useTypedArrays`:
1134
- * === true Use Uint8Array implementation (fastest)
1135
- * === false Use Object implementation (compatible down to IE6)
1136
- */
1137
- Buffer._useTypedArrays = (function () {
1138
- // Detect if browser supports Typed Arrays. Supported browsers are IE 10+, Firefox 4+,
1139
- // Chrome 7+, Safari 5.1+, Opera 11.6+, iOS 4.2+. If the browser does not support adding
1140
- // properties to `Uint8Array` instances, then that's the same as no `Uint8Array` support
1141
- // because we need to be able to add all the node Buffer API methods. This is an issue
1142
- // in Firefox 4-29. Now fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=695438
1143
- try {
1144
- var buf = new ArrayBuffer(0)
1145
- var arr = new Uint8Array(buf)
1146
- arr.foo = function () { return 42 }
1147
- return 42 === arr.foo() &&
1148
- typeof arr.subarray === 'function' // Chrome 9-10 lack `subarray`
1149
- } catch (e) {
1150
- return false
1151
- }
1152
- })()
1153
-
1154
- /**
1155
- * Class: Buffer
1156
- * =============
1157
- *
1158
- * The Buffer constructor returns instances of `Uint8Array` that are augmented
1159
- * with function properties for all the node `Buffer` API functions. We use
1160
- * `Uint8Array` so that square bracket notation works as expected -- it returns
1161
- * a single octet.
1162
- *
1163
- * By augmenting the instances, we can avoid modifying the `Uint8Array`
1164
- * prototype.
1165
- */
1166
- function Buffer (subject, encoding, noZero) {
1167
- if (!(this instanceof Buffer))
1168
- return new Buffer(subject, encoding, noZero)
1169
-
1170
- var type = typeof subject
1171
-
1172
- // Workaround: node's base64 implementation allows for non-padded strings
1173
- // while base64-js does not.
1174
- if (encoding === 'base64' && type === 'string') {
1175
- subject = stringtrim(subject)
1176
- while (subject.length % 4 !== 0) {
1177
- subject = subject + '='
1178
- }
1179
- }
1180
-
1181
- // Find the length
1182
- var length
1183
- if (type === 'number')
1184
- length = coerce(subject)
1185
- else if (type === 'string')
1186
- length = Buffer.byteLength(subject, encoding)
1187
- else if (type === 'object')
1188
- length = coerce(subject.length) // assume that object is array-like
1189
- else
1190
- throw new Error('First argument needs to be a number, array or string.')
1191
-
1192
- var buf
1193
- if (Buffer._useTypedArrays) {
1194
- // Preferred: Return an augmented `Uint8Array` instance for best performance
1195
- buf = Buffer._augment(new Uint8Array(length))
1196
- } else {
1197
- // Fallback: Return THIS instance of Buffer (created by `new`)
1198
- buf = this
1199
- buf.length = length
1200
- buf._isBuffer = true
1201
- }
1202
-
1203
- var i
1204
- if (Buffer._useTypedArrays && typeof subject.byteLength === 'number') {
1205
- // Speed optimization -- use set if we're copying from a typed array
1206
- buf._set(subject)
1207
- } else if (isArrayish(subject)) {
1208
- // Treat array-ish objects as a byte array
1209
- for (i = 0; i < length; i++) {
1210
- if (Buffer.isBuffer(subject))
1211
- buf[i] = subject.readUInt8(i)
1212
- else
1213
- buf[i] = subject[i]
1214
- }
1215
- } else if (type === 'string') {
1216
- buf.write(subject, 0, encoding)
1217
- } else if (type === 'number' && !Buffer._useTypedArrays && !noZero) {
1218
- for (i = 0; i < length; i++) {
1219
- buf[i] = 0
1220
- }
1221
- }
1222
-
1223
- return buf
1224
- }
1225
-
1226
- // STATIC METHODS
1227
- // ==============
1228
-
1229
- Buffer.isEncoding = function (encoding) {
1230
- switch (String(encoding).toLowerCase()) {
1231
- case 'hex':
1232
- case 'utf8':
1233
- case 'utf-8':
1234
- case 'ascii':
1235
- case 'binary':
1236
- case 'base64':
1237
- case 'raw':
1238
- case 'ucs2':
1239
- case 'ucs-2':
1240
- case 'utf16le':
1241
- case 'utf-16le':
1242
- return true
1243
- default:
1244
- return false
1245
- }
1246
- }
1247
-
1248
- Buffer.isBuffer = function (b) {
1249
- return !!(b !== null && b !== undefined && b._isBuffer)
1250
- }
1251
-
1252
- Buffer.byteLength = function (str, encoding) {
1253
- var ret
1254
- str = str + ''
1255
- switch (encoding || 'utf8') {
1256
- case 'hex':
1257
- ret = str.length / 2
1258
- break
1259
- case 'utf8':
1260
- case 'utf-8':
1261
- ret = utf8ToBytes(str).length
1262
- break
1263
- case 'ascii':
1264
- case 'binary':
1265
- case 'raw':
1266
- ret = str.length
1267
- break
1268
- case 'base64':
1269
- ret = base64ToBytes(str).length
1270
- break
1271
- case 'ucs2':
1272
- case 'ucs-2':
1273
- case 'utf16le':
1274
- case 'utf-16le':
1275
- ret = str.length * 2
1276
- break
1277
- default:
1278
- throw new Error('Unknown encoding')
1279
- }
1280
- return ret
1281
- }
1282
-
1283
- Buffer.concat = function (list, totalLength) {
1284
- assert(isArray(list), 'Usage: Buffer.concat(list, [totalLength])\n' +
1285
- 'list should be an Array.')
1286
-
1287
- if (list.length === 0) {
1288
- return new Buffer(0)
1289
- } else if (list.length === 1) {
1290
- return list[0]
1291
- }
1292
-
1293
- var i
1294
- if (typeof totalLength !== 'number') {
1295
- totalLength = 0
1296
- for (i = 0; i < list.length; i++) {
1297
- totalLength += list[i].length
1298
- }
1299
- }
1300
-
1301
- var buf = new Buffer(totalLength)
1302
- var pos = 0
1303
- for (i = 0; i < list.length; i++) {
1304
- var item = list[i]
1305
- item.copy(buf, pos)
1306
- pos += item.length
1307
- }
1308
- return buf
1309
- }
1310
-
1311
- // BUFFER INSTANCE METHODS
1312
- // =======================
1313
-
1314
- function _hexWrite (buf, string, offset, length) {
1315
- offset = Number(offset) || 0
1316
- var remaining = buf.length - offset
1317
- if (!length) {
1318
- length = remaining
1319
- } else {
1320
- length = Number(length)
1321
- if (length > remaining) {
1322
- length = remaining
1323
- }
1324
- }
1325
-
1326
- // must be an even number of digits
1327
- var strLen = string.length
1328
- assert(strLen % 2 === 0, 'Invalid hex string')
1329
-
1330
- if (length > strLen / 2) {
1331
- length = strLen / 2
1332
- }
1333
- for (var i = 0; i < length; i++) {
1334
- var byte = parseInt(string.substr(i * 2, 2), 16)
1335
- assert(!isNaN(byte), 'Invalid hex string')
1336
- buf[offset + i] = byte
1337
- }
1338
- Buffer._charsWritten = i * 2
1339
- return i
1340
- }
1341
-
1342
- function _utf8Write (buf, string, offset, length) {
1343
- var charsWritten = Buffer._charsWritten =
1344
- blitBuffer(utf8ToBytes(string), buf, offset, length)
1345
- return charsWritten
1346
- }
1347
-
1348
- function _asciiWrite (buf, string, offset, length) {
1349
- var charsWritten = Buffer._charsWritten =
1350
- blitBuffer(asciiToBytes(string), buf, offset, length)
1351
- return charsWritten
1352
- }
1353
-
1354
- function _binaryWrite (buf, string, offset, length) {
1355
- return _asciiWrite(buf, string, offset, length)
1356
- }
1357
-
1358
- function _base64Write (buf, string, offset, length) {
1359
- var charsWritten = Buffer._charsWritten =
1360
- blitBuffer(base64ToBytes(string), buf, offset, length)
1361
- return charsWritten
1362
- }
1363
-
1364
- function _utf16leWrite (buf, string, offset, length) {
1365
- var charsWritten = Buffer._charsWritten =
1366
- blitBuffer(utf16leToBytes(string), buf, offset, length)
1367
- return charsWritten
1368
- }
1369
-
1370
- Buffer.prototype.write = function (string, offset, length, encoding) {
1371
- // Support both (string, offset, length, encoding)
1372
- // and the legacy (string, encoding, offset, length)
1373
- if (isFinite(offset)) {
1374
- if (!isFinite(length)) {
1375
- encoding = length
1376
- length = undefined
1377
- }
1378
- } else { // legacy
1379
- var swap = encoding
1380
- encoding = offset
1381
- offset = length
1382
- length = swap
1383
- }
1384
-
1385
- offset = Number(offset) || 0
1386
- var remaining = this.length - offset
1387
- if (!length) {
1388
- length = remaining
1389
- } else {
1390
- length = Number(length)
1391
- if (length > remaining) {
1392
- length = remaining
1393
- }
1394
- }
1395
- encoding = String(encoding || 'utf8').toLowerCase()
1396
-
1397
- var ret
1398
- switch (encoding) {
1399
- case 'hex':
1400
- ret = _hexWrite(this, string, offset, length)
1401
- break
1402
- case 'utf8':
1403
- case 'utf-8':
1404
- ret = _utf8Write(this, string, offset, length)
1405
- break
1406
- case 'ascii':
1407
- ret = _asciiWrite(this, string, offset, length)
1408
- break
1409
- case 'binary':
1410
- ret = _binaryWrite(this, string, offset, length)
1411
- break
1412
- case 'base64':
1413
- ret = _base64Write(this, string, offset, length)
1414
- break
1415
- case 'ucs2':
1416
- case 'ucs-2':
1417
- case 'utf16le':
1418
- case 'utf-16le':
1419
- ret = _utf16leWrite(this, string, offset, length)
1420
- break
1421
- default:
1422
- throw new Error('Unknown encoding')
1423
- }
1424
- return ret
1425
- }
1426
-
1427
- Buffer.prototype.toString = function (encoding, start, end) {
1428
- var self = this
1429
-
1430
- encoding = String(encoding || 'utf8').toLowerCase()
1431
- start = Number(start) || 0
1432
- end = (end !== undefined)
1433
- ? Number(end)
1434
- : end = self.length
1435
-
1436
- // Fastpath empty strings
1437
- if (end === start)
1438
- return ''
1439
-
1440
- var ret
1441
- switch (encoding) {
1442
- case 'hex':
1443
- ret = _hexSlice(self, start, end)
1444
- break
1445
- case 'utf8':
1446
- case 'utf-8':
1447
- ret = _utf8Slice(self, start, end)
1448
- break
1449
- case 'ascii':
1450
- ret = _asciiSlice(self, start, end)
1451
- break
1452
- case 'binary':
1453
- ret = _binarySlice(self, start, end)
1454
- break
1455
- case 'base64':
1456
- ret = _base64Slice(self, start, end)
1457
- break
1458
- case 'ucs2':
1459
- case 'ucs-2':
1460
- case 'utf16le':
1461
- case 'utf-16le':
1462
- ret = _utf16leSlice(self, start, end)
1463
- break
1464
- default:
1465
- throw new Error('Unknown encoding')
1466
- }
1467
- return ret
1468
- }
1469
-
1470
- Buffer.prototype.toJSON = function () {
1471
- return {
1472
- type: 'Buffer',
1473
- data: Array.prototype.slice.call(this._arr || this, 0)
1474
- }
1475
- }
1476
-
1477
- // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
1478
- Buffer.prototype.copy = function (target, target_start, start, end) {
1479
- var source = this
1480
-
1481
- if (!start) start = 0
1482
- if (!end && end !== 0) end = this.length
1483
- if (!target_start) target_start = 0
1484
-
1485
- // Copy 0 bytes; we're done
1486
- if (end === start) return
1487
- if (target.length === 0 || source.length === 0) return
1488
-
1489
- // Fatal error conditions
1490
- assert(end >= start, 'sourceEnd < sourceStart')
1491
- assert(target_start >= 0 && target_start < target.length,
1492
- 'targetStart out of bounds')
1493
- assert(start >= 0 && start < source.length, 'sourceStart out of bounds')
1494
- assert(end >= 0 && end <= source.length, 'sourceEnd out of bounds')
1495
-
1496
- // Are we oob?
1497
- if (end > this.length)
1498
- end = this.length
1499
- if (target.length - target_start < end - start)
1500
- end = target.length - target_start + start
1501
-
1502
- var len = end - start
1503
-
1504
- if (len < 100 || !Buffer._useTypedArrays) {
1505
- for (var i = 0; i < len; i++)
1506
- target[i + target_start] = this[i + start]
1507
- } else {
1508
- target._set(this.subarray(start, start + len), target_start)
1509
- }
1510
- }
1511
-
1512
- function _base64Slice (buf, start, end) {
1513
- if (start === 0 && end === buf.length) {
1514
- return base64.fromByteArray(buf)
1515
- } else {
1516
- return base64.fromByteArray(buf.slice(start, end))
1517
- }
1518
- }
1519
-
1520
- function _utf8Slice (buf, start, end) {
1521
- var res = ''
1522
- var tmp = ''
1523
- end = Math.min(buf.length, end)
1524
-
1525
- for (var i = start; i < end; i++) {
1526
- if (buf[i] <= 0x7F) {
1527
- res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i])
1528
- tmp = ''
1529
- } else {
1530
- tmp += '%' + buf[i].toString(16)
1531
- }
1532
- }
1533
-
1534
- return res + decodeUtf8Char(tmp)
1535
- }
1536
-
1537
- function _asciiSlice (buf, start, end) {
1538
- var ret = ''
1539
- end = Math.min(buf.length, end)
1540
-
1541
- for (var i = start; i < end; i++)
1542
- ret += String.fromCharCode(buf[i])
1543
- return ret
1544
- }
1545
-
1546
- function _binarySlice (buf, start, end) {
1547
- return _asciiSlice(buf, start, end)
1548
- }
1549
-
1550
- function _hexSlice (buf, start, end) {
1551
- var len = buf.length
1552
-
1553
- if (!start || start < 0) start = 0
1554
- if (!end || end < 0 || end > len) end = len
1555
-
1556
- var out = ''
1557
- for (var i = start; i < end; i++) {
1558
- out += toHex(buf[i])
1559
- }
1560
- return out
1561
- }
1562
-
1563
- function _utf16leSlice (buf, start, end) {
1564
- var bytes = buf.slice(start, end)
1565
- var res = ''
1566
- for (var i = 0; i < bytes.length; i += 2) {
1567
- res += String.fromCharCode(bytes[i] + bytes[i+1] * 256)
1568
- }
1569
- return res
1570
- }
1571
-
1572
- Buffer.prototype.slice = function (start, end) {
1573
- var len = this.length
1574
- start = clamp(start, len, 0)
1575
- end = clamp(end, len, len)
1576
-
1577
- if (Buffer._useTypedArrays) {
1578
- return Buffer._augment(this.subarray(start, end))
1579
- } else {
1580
- var sliceLen = end - start
1581
- var newBuf = new Buffer(sliceLen, undefined, true)
1582
- for (var i = 0; i < sliceLen; i++) {
1583
- newBuf[i] = this[i + start]
1584
- }
1585
- return newBuf
1586
- }
1587
- }
1588
-
1589
- // `get` will be removed in Node 0.13+
1590
- Buffer.prototype.get = function (offset) {
1591
- console.log('.get() is deprecated. Access using array indexes instead.')
1592
- return this.readUInt8(offset)
1593
- }
1594
-
1595
- // `set` will be removed in Node 0.13+
1596
- Buffer.prototype.set = function (v, offset) {
1597
- console.log('.set() is deprecated. Access using array indexes instead.')
1598
- return this.writeUInt8(v, offset)
1599
- }
1600
-
1601
- Buffer.prototype.readUInt8 = function (offset, noAssert) {
1602
- if (!noAssert) {
1603
- assert(offset !== undefined && offset !== null, 'missing offset')
1604
- assert(offset < this.length, 'Trying to read beyond buffer length')
1605
- }
1606
-
1607
- if (offset >= this.length)
1608
- return
1609
-
1610
- return this[offset]
1611
- }
1612
-
1613
- function _readUInt16 (buf, offset, littleEndian, noAssert) {
1614
- if (!noAssert) {
1615
- assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
1616
- assert(offset !== undefined && offset !== null, 'missing offset')
1617
- assert(offset + 1 < buf.length, 'Trying to read beyond buffer length')
1618
- }
1619
-
1620
- var len = buf.length
1621
- if (offset >= len)
1622
- return
1623
-
1624
- var val
1625
- if (littleEndian) {
1626
- val = buf[offset]
1627
- if (offset + 1 < len)
1628
- val |= buf[offset + 1] << 8
1629
- } else {
1630
- val = buf[offset] << 8
1631
- if (offset + 1 < len)
1632
- val |= buf[offset + 1]
1633
- }
1634
- return val
1635
- }
1636
-
1637
- Buffer.prototype.readUInt16LE = function (offset, noAssert) {
1638
- return _readUInt16(this, offset, true, noAssert)
1639
- }
1640
-
1641
- Buffer.prototype.readUInt16BE = function (offset, noAssert) {
1642
- return _readUInt16(this, offset, false, noAssert)
1643
- }
1644
-
1645
- function _readUInt32 (buf, offset, littleEndian, noAssert) {
1646
- if (!noAssert) {
1647
- assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
1648
- assert(offset !== undefined && offset !== null, 'missing offset')
1649
- assert(offset + 3 < buf.length, 'Trying to read beyond buffer length')
1650
- }
1651
-
1652
- var len = buf.length
1653
- if (offset >= len)
1654
- return
1655
-
1656
- var val
1657
- if (littleEndian) {
1658
- if (offset + 2 < len)
1659
- val = buf[offset + 2] << 16
1660
- if (offset + 1 < len)
1661
- val |= buf[offset + 1] << 8
1662
- val |= buf[offset]
1663
- if (offset + 3 < len)
1664
- val = val + (buf[offset + 3] << 24 >>> 0)
1665
- } else {
1666
- if (offset + 1 < len)
1667
- val = buf[offset + 1] << 16
1668
- if (offset + 2 < len)
1669
- val |= buf[offset + 2] << 8
1670
- if (offset + 3 < len)
1671
- val |= buf[offset + 3]
1672
- val = val + (buf[offset] << 24 >>> 0)
1673
- }
1674
- return val
1675
- }
1676
-
1677
- Buffer.prototype.readUInt32LE = function (offset, noAssert) {
1678
- return _readUInt32(this, offset, true, noAssert)
1679
- }
1680
-
1681
- Buffer.prototype.readUInt32BE = function (offset, noAssert) {
1682
- return _readUInt32(this, offset, false, noAssert)
1683
- }
1684
-
1685
- Buffer.prototype.readInt8 = function (offset, noAssert) {
1686
- if (!noAssert) {
1687
- assert(offset !== undefined && offset !== null,
1688
- 'missing offset')
1689
- assert(offset < this.length, 'Trying to read beyond buffer length')
1690
- }
1691
-
1692
- if (offset >= this.length)
1693
- return
1694
-
1695
- var neg = this[offset] & 0x80
1696
- if (neg)
1697
- return (0xff - this[offset] + 1) * -1
1698
- else
1699
- return this[offset]
1700
- }
1701
-
1702
- function _readInt16 (buf, offset, littleEndian, noAssert) {
1703
- if (!noAssert) {
1704
- assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
1705
- assert(offset !== undefined && offset !== null, 'missing offset')
1706
- assert(offset + 1 < buf.length, 'Trying to read beyond buffer length')
1707
- }
1708
-
1709
- var len = buf.length
1710
- if (offset >= len)
1711
- return
1712
-
1713
- var val = _readUInt16(buf, offset, littleEndian, true)
1714
- var neg = val & 0x8000
1715
- if (neg)
1716
- return (0xffff - val + 1) * -1
1717
- else
1718
- return val
1719
- }
1720
-
1721
- Buffer.prototype.readInt16LE = function (offset, noAssert) {
1722
- return _readInt16(this, offset, true, noAssert)
1723
- }
1724
-
1725
- Buffer.prototype.readInt16BE = function (offset, noAssert) {
1726
- return _readInt16(this, offset, false, noAssert)
1727
- }
1728
-
1729
- function _readInt32 (buf, offset, littleEndian, noAssert) {
1730
- if (!noAssert) {
1731
- assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
1732
- assert(offset !== undefined && offset !== null, 'missing offset')
1733
- assert(offset + 3 < buf.length, 'Trying to read beyond buffer length')
1734
- }
1735
-
1736
- var len = buf.length
1737
- if (offset >= len)
1738
- return
1739
-
1740
- var val = _readUInt32(buf, offset, littleEndian, true)
1741
- var neg = val & 0x80000000
1742
- if (neg)
1743
- return (0xffffffff - val + 1) * -1
1744
- else
1745
- return val
1746
- }
1747
-
1748
- Buffer.prototype.readInt32LE = function (offset, noAssert) {
1749
- return _readInt32(this, offset, true, noAssert)
1750
- }
1751
-
1752
- Buffer.prototype.readInt32BE = function (offset, noAssert) {
1753
- return _readInt32(this, offset, false, noAssert)
1754
- }
1755
-
1756
- function _readFloat (buf, offset, littleEndian, noAssert) {
1757
- if (!noAssert) {
1758
- assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
1759
- assert(offset + 3 < buf.length, 'Trying to read beyond buffer length')
1760
- }
1761
-
1762
- return ieee754.read(buf, offset, littleEndian, 23, 4)
1763
- }
1764
-
1765
- Buffer.prototype.readFloatLE = function (offset, noAssert) {
1766
- return _readFloat(this, offset, true, noAssert)
1767
- }
1768
-
1769
- Buffer.prototype.readFloatBE = function (offset, noAssert) {
1770
- return _readFloat(this, offset, false, noAssert)
1771
- }
1772
-
1773
- function _readDouble (buf, offset, littleEndian, noAssert) {
1774
- if (!noAssert) {
1775
- assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
1776
- assert(offset + 7 < buf.length, 'Trying to read beyond buffer length')
1777
- }
1778
-
1779
- return ieee754.read(buf, offset, littleEndian, 52, 8)
1780
- }
1781
-
1782
- Buffer.prototype.readDoubleLE = function (offset, noAssert) {
1783
- return _readDouble(this, offset, true, noAssert)
1784
- }
1785
-
1786
- Buffer.prototype.readDoubleBE = function (offset, noAssert) {
1787
- return _readDouble(this, offset, false, noAssert)
1788
- }
1789
-
1790
- Buffer.prototype.writeUInt8 = function (value, offset, noAssert) {
1791
- if (!noAssert) {
1792
- assert(value !== undefined && value !== null, 'missing value')
1793
- assert(offset !== undefined && offset !== null, 'missing offset')
1794
- assert(offset < this.length, 'trying to write beyond buffer length')
1795
- verifuint(value, 0xff)
1796
- }
1797
-
1798
- if (offset >= this.length) return
1799
-
1800
- this[offset] = value
1801
- }
1802
-
1803
- function _writeUInt16 (buf, value, offset, littleEndian, noAssert) {
1804
- if (!noAssert) {
1805
- assert(value !== undefined && value !== null, 'missing value')
1806
- assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
1807
- assert(offset !== undefined && offset !== null, 'missing offset')
1808
- assert(offset + 1 < buf.length, 'trying to write beyond buffer length')
1809
- verifuint(value, 0xffff)
1810
- }
1811
-
1812
- var len = buf.length
1813
- if (offset >= len)
1814
- return
1815
-
1816
- for (var i = 0, j = Math.min(len - offset, 2); i < j; i++) {
1817
- buf[offset + i] =
1818
- (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
1819
- (littleEndian ? i : 1 - i) * 8
1820
- }
1821
- }
1822
-
1823
- Buffer.prototype.writeUInt16LE = function (value, offset, noAssert) {
1824
- _writeUInt16(this, value, offset, true, noAssert)
1825
- }
1826
-
1827
- Buffer.prototype.writeUInt16BE = function (value, offset, noAssert) {
1828
- _writeUInt16(this, value, offset, false, noAssert)
1829
- }
1830
-
1831
- function _writeUInt32 (buf, value, offset, littleEndian, noAssert) {
1832
- if (!noAssert) {
1833
- assert(value !== undefined && value !== null, 'missing value')
1834
- assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
1835
- assert(offset !== undefined && offset !== null, 'missing offset')
1836
- assert(offset + 3 < buf.length, 'trying to write beyond buffer length')
1837
- verifuint(value, 0xffffffff)
1838
- }
1839
-
1840
- var len = buf.length
1841
- if (offset >= len)
1842
- return
1843
-
1844
- for (var i = 0, j = Math.min(len - offset, 4); i < j; i++) {
1845
- buf[offset + i] =
1846
- (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
1847
- }
1848
- }
1849
-
1850
- Buffer.prototype.writeUInt32LE = function (value, offset, noAssert) {
1851
- _writeUInt32(this, value, offset, true, noAssert)
1852
- }
1853
-
1854
- Buffer.prototype.writeUInt32BE = function (value, offset, noAssert) {
1855
- _writeUInt32(this, value, offset, false, noAssert)
1856
- }
1857
-
1858
- Buffer.prototype.writeInt8 = function (value, offset, noAssert) {
1859
- if (!noAssert) {
1860
- assert(value !== undefined && value !== null, 'missing value')
1861
- assert(offset !== undefined && offset !== null, 'missing offset')
1862
- assert(offset < this.length, 'Trying to write beyond buffer length')
1863
- verifsint(value, 0x7f, -0x80)
1864
- }
1865
-
1866
- if (offset >= this.length)
1867
- return
1868
-
1869
- if (value >= 0)
1870
- this.writeUInt8(value, offset, noAssert)
1871
- else
1872
- this.writeUInt8(0xff + value + 1, offset, noAssert)
1873
- }
1874
-
1875
- function _writeInt16 (buf, value, offset, littleEndian, noAssert) {
1876
- if (!noAssert) {
1877
- assert(value !== undefined && value !== null, 'missing value')
1878
- assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
1879
- assert(offset !== undefined && offset !== null, 'missing offset')
1880
- assert(offset + 1 < buf.length, 'Trying to write beyond buffer length')
1881
- verifsint(value, 0x7fff, -0x8000)
1882
- }
1883
-
1884
- var len = buf.length
1885
- if (offset >= len)
1886
- return
1887
-
1888
- if (value >= 0)
1889
- _writeUInt16(buf, value, offset, littleEndian, noAssert)
1890
- else
1891
- _writeUInt16(buf, 0xffff + value + 1, offset, littleEndian, noAssert)
1892
- }
1893
-
1894
- Buffer.prototype.writeInt16LE = function (value, offset, noAssert) {
1895
- _writeInt16(this, value, offset, true, noAssert)
1896
- }
1897
-
1898
- Buffer.prototype.writeInt16BE = function (value, offset, noAssert) {
1899
- _writeInt16(this, value, offset, false, noAssert)
1900
- }
1901
-
1902
- function _writeInt32 (buf, value, offset, littleEndian, noAssert) {
1903
- if (!noAssert) {
1904
- assert(value !== undefined && value !== null, 'missing value')
1905
- assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
1906
- assert(offset !== undefined && offset !== null, 'missing offset')
1907
- assert(offset + 3 < buf.length, 'Trying to write beyond buffer length')
1908
- verifsint(value, 0x7fffffff, -0x80000000)
1909
- }
1910
-
1911
- var len = buf.length
1912
- if (offset >= len)
1913
- return
1914
-
1915
- if (value >= 0)
1916
- _writeUInt32(buf, value, offset, littleEndian, noAssert)
1917
- else
1918
- _writeUInt32(buf, 0xffffffff + value + 1, offset, littleEndian, noAssert)
1919
- }
1920
-
1921
- Buffer.prototype.writeInt32LE = function (value, offset, noAssert) {
1922
- _writeInt32(this, value, offset, true, noAssert)
1923
- }
1924
-
1925
- Buffer.prototype.writeInt32BE = function (value, offset, noAssert) {
1926
- _writeInt32(this, value, offset, false, noAssert)
1927
- }
1928
-
1929
- function _writeFloat (buf, value, offset, littleEndian, noAssert) {
1930
- if (!noAssert) {
1931
- assert(value !== undefined && value !== null, 'missing value')
1932
- assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
1933
- assert(offset !== undefined && offset !== null, 'missing offset')
1934
- assert(offset + 3 < buf.length, 'Trying to write beyond buffer length')
1935
- verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38)
1936
- }
1937
-
1938
- var len = buf.length
1939
- if (offset >= len)
1940
- return
1941
-
1942
- ieee754.write(buf, value, offset, littleEndian, 23, 4)
1943
- }
1944
-
1945
- Buffer.prototype.writeFloatLE = function (value, offset, noAssert) {
1946
- _writeFloat(this, value, offset, true, noAssert)
1947
- }
1948
-
1949
- Buffer.prototype.writeFloatBE = function (value, offset, noAssert) {
1950
- _writeFloat(this, value, offset, false, noAssert)
1951
- }
1952
-
1953
- function _writeDouble (buf, value, offset, littleEndian, noAssert) {
1954
- if (!noAssert) {
1955
- assert(value !== undefined && value !== null, 'missing value')
1956
- assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
1957
- assert(offset !== undefined && offset !== null, 'missing offset')
1958
- assert(offset + 7 < buf.length,
1959
- 'Trying to write beyond buffer length')
1960
- verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308)
1961
- }
1962
-
1963
- var len = buf.length
1964
- if (offset >= len)
1965
- return
1966
-
1967
- ieee754.write(buf, value, offset, littleEndian, 52, 8)
1968
- }
1969
-
1970
- Buffer.prototype.writeDoubleLE = function (value, offset, noAssert) {
1971
- _writeDouble(this, value, offset, true, noAssert)
1972
- }
1973
-
1974
- Buffer.prototype.writeDoubleBE = function (value, offset, noAssert) {
1975
- _writeDouble(this, value, offset, false, noAssert)
1976
- }
1977
-
1978
- // fill(value, start=0, end=buffer.length)
1979
- Buffer.prototype.fill = function (value, start, end) {
1980
- if (!value) value = 0
1981
- if (!start) start = 0
1982
- if (!end) end = this.length
1983
-
1984
- if (typeof value === 'string') {
1985
- value = value.charCodeAt(0)
1986
- }
1987
-
1988
- assert(typeof value === 'number' && !isNaN(value), 'value is not a number')
1989
- assert(end >= start, 'end < start')
1990
-
1991
- // Fill 0 bytes; we're done
1992
- if (end === start) return
1993
- if (this.length === 0) return
1994
-
1995
- assert(start >= 0 && start < this.length, 'start out of bounds')
1996
- assert(end >= 0 && end <= this.length, 'end out of bounds')
1997
-
1998
- for (var i = start; i < end; i++) {
1999
- this[i] = value
2000
- }
2001
- }
2002
-
2003
- Buffer.prototype.inspect = function () {
2004
- var out = []
2005
- var len = this.length
2006
- for (var i = 0; i < len; i++) {
2007
- out[i] = toHex(this[i])
2008
- if (i === exports.INSPECT_MAX_BYTES) {
2009
- out[i + 1] = '...'
2010
- break
2011
- }
2012
- }
2013
- return '<Buffer ' + out.join(' ') + '>'
2014
- }
2015
-
2016
- /**
2017
- * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance.
2018
- * Added in Node 0.12. Only available in browsers that support ArrayBuffer.
2019
- */
2020
- Buffer.prototype.toArrayBuffer = function () {
2021
- if (typeof Uint8Array !== 'undefined') {
2022
- if (Buffer._useTypedArrays) {
2023
- return (new Buffer(this)).buffer
2024
- } else {
2025
- var buf = new Uint8Array(this.length)
2026
- for (var i = 0, len = buf.length; i < len; i += 1)
2027
- buf[i] = this[i]
2028
- return buf.buffer
2029
- }
2030
- } else {
2031
- throw new Error('Buffer.toArrayBuffer not supported in this browser')
2032
- }
2033
- }
2034
-
2035
- // HELPER FUNCTIONS
2036
- // ================
2037
-
2038
- function stringtrim (str) {
2039
- if (str.trim) return str.trim()
2040
- return str.replace(/^\s+|\s+$/g, '')
2041
- }
2042
-
2043
- var BP = Buffer.prototype
2044
-
2045
- /**
2046
- * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods
2047
- */
2048
- Buffer._augment = function (arr) {
2049
- arr._isBuffer = true
2050
-
2051
- // save reference to original Uint8Array get/set methods before overwriting
2052
- arr._get = arr.get
2053
- arr._set = arr.set
2054
-
2055
- // deprecated, will be removed in node 0.13+
2056
- arr.get = BP.get
2057
- arr.set = BP.set
2058
-
2059
- arr.write = BP.write
2060
- arr.toString = BP.toString
2061
- arr.toLocaleString = BP.toString
2062
- arr.toJSON = BP.toJSON
2063
- arr.copy = BP.copy
2064
- arr.slice = BP.slice
2065
- arr.readUInt8 = BP.readUInt8
2066
- arr.readUInt16LE = BP.readUInt16LE
2067
- arr.readUInt16BE = BP.readUInt16BE
2068
- arr.readUInt32LE = BP.readUInt32LE
2069
- arr.readUInt32BE = BP.readUInt32BE
2070
- arr.readInt8 = BP.readInt8
2071
- arr.readInt16LE = BP.readInt16LE
2072
- arr.readInt16BE = BP.readInt16BE
2073
- arr.readInt32LE = BP.readInt32LE
2074
- arr.readInt32BE = BP.readInt32BE
2075
- arr.readFloatLE = BP.readFloatLE
2076
- arr.readFloatBE = BP.readFloatBE
2077
- arr.readDoubleLE = BP.readDoubleLE
2078
- arr.readDoubleBE = BP.readDoubleBE
2079
- arr.writeUInt8 = BP.writeUInt8
2080
- arr.writeUInt16LE = BP.writeUInt16LE
2081
- arr.writeUInt16BE = BP.writeUInt16BE
2082
- arr.writeUInt32LE = BP.writeUInt32LE
2083
- arr.writeUInt32BE = BP.writeUInt32BE
2084
- arr.writeInt8 = BP.writeInt8
2085
- arr.writeInt16LE = BP.writeInt16LE
2086
- arr.writeInt16BE = BP.writeInt16BE
2087
- arr.writeInt32LE = BP.writeInt32LE
2088
- arr.writeInt32BE = BP.writeInt32BE
2089
- arr.writeFloatLE = BP.writeFloatLE
2090
- arr.writeFloatBE = BP.writeFloatBE
2091
- arr.writeDoubleLE = BP.writeDoubleLE
2092
- arr.writeDoubleBE = BP.writeDoubleBE
2093
- arr.fill = BP.fill
2094
- arr.inspect = BP.inspect
2095
- arr.toArrayBuffer = BP.toArrayBuffer
2096
-
2097
- return arr
2098
- }
2099
-
2100
- // slice(start, end)
2101
- function clamp (index, len, defaultValue) {
2102
- if (typeof index !== 'number') return defaultValue
2103
- index = ~~index; // Coerce to integer.
2104
- if (index >= len) return len
2105
- if (index >= 0) return index
2106
- index += len
2107
- if (index >= 0) return index
2108
- return 0
2109
- }
2110
-
2111
- function coerce (length) {
2112
- // Coerce length to a number (possibly NaN), round up
2113
- // in case it's fractional (e.g. 123.456) then do a
2114
- // double negate to coerce a NaN to 0. Easy, right?
2115
- length = ~~Math.ceil(+length)
2116
- return length < 0 ? 0 : length
2117
- }
2118
-
2119
- function isArray (subject) {
2120
- return (Array.isArray || function (subject) {
2121
- return Object.prototype.toString.call(subject) === '[object Array]'
2122
- })(subject)
2123
- }
2124
-
2125
- function isArrayish (subject) {
2126
- return isArray(subject) || Buffer.isBuffer(subject) ||
2127
- subject && typeof subject === 'object' &&
2128
- typeof subject.length === 'number'
2129
- }
2130
-
2131
- function toHex (n) {
2132
- if (n < 16) return '0' + n.toString(16)
2133
- return n.toString(16)
2134
- }
2135
-
2136
- function utf8ToBytes (str) {
2137
- var byteArray = []
2138
- for (var i = 0; i < str.length; i++) {
2139
- var b = str.charCodeAt(i)
2140
- if (b <= 0x7F)
2141
- byteArray.push(str.charCodeAt(i))
2142
- else {
2143
- var start = i
2144
- if (b >= 0xD800 && b <= 0xDFFF) i++
2145
- var h = encodeURIComponent(str.slice(start, i+1)).substr(1).split('%')
2146
- for (var j = 0; j < h.length; j++)
2147
- byteArray.push(parseInt(h[j], 16))
2148
- }
2149
- }
2150
- return byteArray
2151
- }
2152
-
2153
- function asciiToBytes (str) {
2154
- var byteArray = []
2155
- for (var i = 0; i < str.length; i++) {
2156
- // Node's code seems to be doing this and not & 0x7F..
2157
- byteArray.push(str.charCodeAt(i) & 0xFF)
2158
- }
2159
- return byteArray
2160
- }
2161
-
2162
- function utf16leToBytes (str) {
2163
- var c, hi, lo
2164
- var byteArray = []
2165
- for (var i = 0; i < str.length; i++) {
2166
- c = str.charCodeAt(i)
2167
- hi = c >> 8
2168
- lo = c % 256
2169
- byteArray.push(lo)
2170
- byteArray.push(hi)
2171
- }
2172
-
2173
- return byteArray
2174
- }
2175
-
2176
- function base64ToBytes (str) {
2177
- return base64.toByteArray(str)
2178
- }
2179
-
2180
- function blitBuffer (src, dst, offset, length) {
2181
- var pos
2182
- for (var i = 0; i < length; i++) {
2183
- if ((i + offset >= dst.length) || (i >= src.length))
2184
- break
2185
- dst[i + offset] = src[i]
2186
- }
2187
- return i
2188
- }
2189
-
2190
- function decodeUtf8Char (str) {
2191
- try {
2192
- return decodeURIComponent(str)
2193
- } catch (err) {
2194
- return String.fromCharCode(0xFFFD) // UTF 8 invalid char
2195
- }
2196
- }
2197
-
2198
- /*
2199
- * We have to make sure that the value is a valid integer. This means that it
2200
- * is non-negative. It has no fractional component and that it does not
2201
- * exceed the maximum allowed value.
2202
- */
2203
- function verifuint (value, max) {
2204
- assert(typeof value === 'number', 'cannot write a non-number as a number')
2205
- assert(value >= 0, 'specified a negative value for writing an unsigned value')
2206
- assert(value <= max, 'value is larger than maximum value for type')
2207
- assert(Math.floor(value) === value, 'value has a fractional component')
2208
- }
2209
-
2210
- function verifsint (value, max, min) {
2211
- assert(typeof value === 'number', 'cannot write a non-number as a number')
2212
- assert(value <= max, 'value larger than maximum allowed value')
2213
- assert(value >= min, 'value smaller than minimum allowed value')
2214
- assert(Math.floor(value) === value, 'value has a fractional component')
2215
- }
2216
-
2217
- function verifIEEE754 (value, max, min) {
2218
- assert(typeof value === 'number', 'cannot write a non-number as a number')
2219
- assert(value <= max, 'value larger than maximum allowed value')
2220
- assert(value >= min, 'value smaller than minimum allowed value')
2221
- }
2222
-
2223
- function assert (test, message) {
2224
- if (!test) throw new Error(message || 'Failed assertion')
2225
- }
2226
-
2227
- },{"base64-js":6,"ieee754":18}],8:[function(require,module,exports){
2228
- // Copyright Joyent, Inc. and other Node contributors.
2229
- //
2230
- // Permission is hereby granted, free of charge, to any person obtaining a
2231
- // copy of this software and associated documentation files (the
2232
- // "Software"), to deal in the Software without restriction, including
2233
- // without limitation the rights to use, copy, modify, merge, publish,
2234
- // distribute, sublicense, and/or sell copies of the Software, and to permit
2235
- // persons to whom the Software is furnished to do so, subject to the
2236
- // following conditions:
2237
- //
2238
- // The above copyright notice and this permission notice shall be included
2239
- // in all copies or substantial portions of the Software.
2240
- //
2241
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2242
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2243
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2244
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2245
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2246
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2247
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
2248
-
2249
- function EventEmitter() {
2250
- this._events = this._events || {};
2251
- this._maxListeners = this._maxListeners || undefined;
2252
- }
2253
- module.exports = EventEmitter;
2254
-
2255
- // Backwards-compat with node 0.10.x
2256
- EventEmitter.EventEmitter = EventEmitter;
2257
-
2258
- EventEmitter.prototype._events = undefined;
2259
- EventEmitter.prototype._maxListeners = undefined;
2260
-
2261
- // By default EventEmitters will print a warning if more than 10 listeners are
2262
- // added to it. This is a useful default which helps finding memory leaks.
2263
- EventEmitter.defaultMaxListeners = 10;
2264
-
2265
- // Obviously not all Emitters should be limited to 10. This function allows
2266
- // that to be increased. Set to zero for unlimited.
2267
- EventEmitter.prototype.setMaxListeners = function(n) {
2268
- if (!isNumber(n) || n < 0 || isNaN(n))
2269
- throw TypeError('n must be a positive number');
2270
- this._maxListeners = n;
2271
- return this;
2272
- };
2273
-
2274
- EventEmitter.prototype.emit = function(type) {
2275
- var er, handler, len, args, i, listeners;
2276
-
2277
- if (!this._events)
2278
- this._events = {};
2279
-
2280
- // If there is no 'error' event listener then throw.
2281
- if (type === 'error') {
2282
- if (!this._events.error ||
2283
- (isObject(this._events.error) && !this._events.error.length)) {
2284
- er = arguments[1];
2285
- if (er instanceof Error) {
2286
- throw er; // Unhandled 'error' event
2287
- }
2288
- throw TypeError('Uncaught, unspecified "error" event.');
2289
- }
2290
- }
2291
-
2292
- handler = this._events[type];
2293
-
2294
- if (isUndefined(handler))
2295
- return false;
2296
-
2297
- if (isFunction(handler)) {
2298
- switch (arguments.length) {
2299
- // fast cases
2300
- case 1:
2301
- handler.call(this);
2302
- break;
2303
- case 2:
2304
- handler.call(this, arguments[1]);
2305
- break;
2306
- case 3:
2307
- handler.call(this, arguments[1], arguments[2]);
2308
- break;
2309
- // slower
2310
- default:
2311
- len = arguments.length;
2312
- args = new Array(len - 1);
2313
- for (i = 1; i < len; i++)
2314
- args[i - 1] = arguments[i];
2315
- handler.apply(this, args);
2316
- }
2317
- } else if (isObject(handler)) {
2318
- len = arguments.length;
2319
- args = new Array(len - 1);
2320
- for (i = 1; i < len; i++)
2321
- args[i - 1] = arguments[i];
2322
-
2323
- listeners = handler.slice();
2324
- len = listeners.length;
2325
- for (i = 0; i < len; i++)
2326
- listeners[i].apply(this, args);
2327
- }
2328
-
2329
- return true;
2330
- };
2331
-
2332
- EventEmitter.prototype.addListener = function(type, listener) {
2333
- var m;
2334
-
2335
- if (!isFunction(listener))
2336
- throw TypeError('listener must be a function');
2337
-
2338
- if (!this._events)
2339
- this._events = {};
2340
-
2341
- // To avoid recursion in the case that type === "newListener"! Before
2342
- // adding it to the listeners, first emit "newListener".
2343
- if (this._events.newListener)
2344
- this.emit('newListener', type,
2345
- isFunction(listener.listener) ?
2346
- listener.listener : listener);
2347
-
2348
- if (!this._events[type])
2349
- // Optimize the case of one listener. Don't need the extra array object.
2350
- this._events[type] = listener;
2351
- else if (isObject(this._events[type]))
2352
- // If we've already got an array, just append.
2353
- this._events[type].push(listener);
2354
- else
2355
- // Adding the second element, need to change to array.
2356
- this._events[type] = [this._events[type], listener];
2357
-
2358
- // Check for listener leak
2359
- if (isObject(this._events[type]) && !this._events[type].warned) {
2360
- var m;
2361
- if (!isUndefined(this._maxListeners)) {
2362
- m = this._maxListeners;
2363
- } else {
2364
- m = EventEmitter.defaultMaxListeners;
2365
- }
2366
-
2367
- if (m && m > 0 && this._events[type].length > m) {
2368
- this._events[type].warned = true;
2369
- console.error('(node) warning: possible EventEmitter memory ' +
2370
- 'leak detected. %d listeners added. ' +
2371
- 'Use emitter.setMaxListeners() to increase limit.',
2372
- this._events[type].length);
2373
- if (typeof console.trace === 'function') {
2374
- // not supported in IE 10
2375
- console.trace();
2376
- }
2377
- }
2378
- }
2379
-
2380
- return this;
2381
- };
2382
-
2383
- EventEmitter.prototype.on = EventEmitter.prototype.addListener;
2384
-
2385
- EventEmitter.prototype.once = function(type, listener) {
2386
- if (!isFunction(listener))
2387
- throw TypeError('listener must be a function');
2388
-
2389
- var fired = false;
2390
-
2391
- function g() {
2392
- this.removeListener(type, g);
2393
-
2394
- if (!fired) {
2395
- fired = true;
2396
- listener.apply(this, arguments);
2397
- }
2398
- }
2399
-
2400
- g.listener = listener;
2401
- this.on(type, g);
2402
-
2403
- return this;
2404
- };
2405
-
2406
- // emits a 'removeListener' event iff the listener was removed
2407
- EventEmitter.prototype.removeListener = function(type, listener) {
2408
- var list, position, length, i;
2409
-
2410
- if (!isFunction(listener))
2411
- throw TypeError('listener must be a function');
2412
-
2413
- if (!this._events || !this._events[type])
2414
- return this;
2415
-
2416
- list = this._events[type];
2417
- length = list.length;
2418
- position = -1;
2419
-
2420
- if (list === listener ||
2421
- (isFunction(list.listener) && list.listener === listener)) {
2422
- delete this._events[type];
2423
- if (this._events.removeListener)
2424
- this.emit('removeListener', type, listener);
2425
-
2426
- } else if (isObject(list)) {
2427
- for (i = length; i-- > 0;) {
2428
- if (list[i] === listener ||
2429
- (list[i].listener && list[i].listener === listener)) {
2430
- position = i;
2431
- break;
2432
- }
2433
- }
2434
-
2435
- if (position < 0)
2436
- return this;
2437
-
2438
- if (list.length === 1) {
2439
- list.length = 0;
2440
- delete this._events[type];
2441
- } else {
2442
- list.splice(position, 1);
2443
- }
2444
-
2445
- if (this._events.removeListener)
2446
- this.emit('removeListener', type, listener);
2447
- }
2448
-
2449
- return this;
2450
- };
2451
-
2452
- EventEmitter.prototype.removeAllListeners = function(type) {
2453
- var key, listeners;
2454
-
2455
- if (!this._events)
2456
- return this;
2457
-
2458
- // not listening for removeListener, no need to emit
2459
- if (!this._events.removeListener) {
2460
- if (arguments.length === 0)
2461
- this._events = {};
2462
- else if (this._events[type])
2463
- delete this._events[type];
2464
- return this;
2465
- }
2466
-
2467
- // emit removeListener for all listeners on all events
2468
- if (arguments.length === 0) {
2469
- for (key in this._events) {
2470
- if (key === 'removeListener') continue;
2471
- this.removeAllListeners(key);
2472
- }
2473
- this.removeAllListeners('removeListener');
2474
- this._events = {};
2475
- return this;
2476
- }
2477
-
2478
- listeners = this._events[type];
2479
-
2480
- if (isFunction(listeners)) {
2481
- this.removeListener(type, listeners);
2482
- } else {
2483
- // LIFO order
2484
- while (listeners.length)
2485
- this.removeListener(type, listeners[listeners.length - 1]);
2486
- }
2487
- delete this._events[type];
2488
-
2489
- return this;
2490
- };
2491
-
2492
- EventEmitter.prototype.listeners = function(type) {
2493
- var ret;
2494
- if (!this._events || !this._events[type])
2495
- ret = [];
2496
- else if (isFunction(this._events[type]))
2497
- ret = [this._events[type]];
2498
- else
2499
- ret = this._events[type].slice();
2500
- return ret;
2501
- };
2502
-
2503
- EventEmitter.listenerCount = function(emitter, type) {
2504
- var ret;
2505
- if (!emitter._events || !emitter._events[type])
2506
- ret = 0;
2507
- else if (isFunction(emitter._events[type]))
2508
- ret = 1;
2509
- else
2510
- ret = emitter._events[type].length;
2511
- return ret;
2512
- };
2513
-
2514
- function isFunction(arg) {
2515
- return typeof arg === 'function';
2516
- }
2517
-
2518
- function isNumber(arg) {
2519
- return typeof arg === 'number';
2520
- }
2521
-
2522
- function isObject(arg) {
2523
- return typeof arg === 'object' && arg !== null;
2524
- }
2525
-
2526
- function isUndefined(arg) {
2527
- return arg === void 0;
2528
- }
2529
-
2530
- },{}],9:[function(require,module,exports){
2531
- // shim for using process in browser
2532
-
2533
- var process = module.exports = {};
2534
-
2535
- process.nextTick = (function () {
2536
- var canSetImmediate = typeof window !== 'undefined'
2537
- && window.setImmediate;
2538
- var canPost = typeof window !== 'undefined'
2539
- && window.postMessage && window.addEventListener
2540
- ;
2541
-
2542
- if (canSetImmediate) {
2543
- return function (f) { return window.setImmediate(f) };
2544
- }
2545
-
2546
- if (canPost) {
2547
- var queue = [];
2548
- window.addEventListener('message', function (ev) {
2549
- var source = ev.source;
2550
- if ((source === window || source === null) && ev.data === 'process-tick') {
2551
- ev.stopPropagation();
2552
- if (queue.length > 0) {
2553
- var fn = queue.shift();
2554
- fn();
2555
- }
2556
- }
2557
- }, true);
2558
-
2559
- return function nextTick(fn) {
2560
- queue.push(fn);
2561
- window.postMessage('process-tick', '*');
2562
- };
2563
- }
2564
-
2565
- return function nextTick(fn) {
2566
- setTimeout(fn, 0);
2567
- };
2568
- })();
2569
-
2570
- process.title = 'browser';
2571
- process.browser = true;
2572
- process.env = {};
2573
- process.argv = [];
2574
-
2575
- function noop() {}
2576
-
2577
- process.on = noop;
2578
- process.addListener = noop;
2579
- process.once = noop;
2580
- process.off = noop;
2581
- process.removeListener = noop;
2582
- process.removeAllListeners = noop;
2583
- process.emit = noop;
2584
-
2585
- process.binding = function (name) {
2586
- throw new Error('process.binding is not supported');
2587
- }
2588
-
2589
- // TODO(shtylman)
2590
- process.cwd = function () { return '/' };
2591
- process.chdir = function (dir) {
2592
- throw new Error('process.chdir is not supported');
2593
- };
2594
-
2595
- },{}],10:[function(require,module,exports){
2596
- // Copyright Joyent, Inc. and other Node contributors.
2597
- //
2598
- // Permission is hereby granted, free of charge, to any person obtaining a
2599
- // copy of this software and associated documentation files (the
2600
- // "Software"), to deal in the Software without restriction, including
2601
- // without limitation the rights to use, copy, modify, merge, publish,
2602
- // distribute, sublicense, and/or sell copies of the Software, and to permit
2603
- // persons to whom the Software is furnished to do so, subject to the
2604
- // following conditions:
2605
- //
2606
- // The above copyright notice and this permission notice shall be included
2607
- // in all copies or substantial portions of the Software.
2608
- //
2609
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2610
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2611
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2612
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2613
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2614
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2615
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
2616
-
2617
- // a duplex stream is just a stream that is both readable and writable.
2618
- // Since JS doesn't have multiple prototypal inheritance, this class
2619
- // prototypally inherits from Readable, and then parasitically from
2620
- // Writable.
2621
-
2622
- module.exports = Duplex;
2623
- var inherits = require('inherits');
2624
- var setImmediate = require('process/browser.js').nextTick;
2625
- var Readable = require('./readable.js');
2626
- var Writable = require('./writable.js');
2627
-
2628
- inherits(Duplex, Readable);
2629
-
2630
- Duplex.prototype.write = Writable.prototype.write;
2631
- Duplex.prototype.end = Writable.prototype.end;
2632
- Duplex.prototype._write = Writable.prototype._write;
2633
-
2634
- function Duplex(options) {
2635
- if (!(this instanceof Duplex))
2636
- return new Duplex(options);
2637
-
2638
- Readable.call(this, options);
2639
- Writable.call(this, options);
2640
-
2641
- if (options && options.readable === false)
2642
- this.readable = false;
2643
-
2644
- if (options && options.writable === false)
2645
- this.writable = false;
2646
-
2647
- this.allowHalfOpen = true;
2648
- if (options && options.allowHalfOpen === false)
2649
- this.allowHalfOpen = false;
2650
-
2651
- this.once('end', onend);
2652
- }
2653
-
2654
- // the no-half-open enforcer
2655
- function onend() {
2656
- // if we allow half-open state, or if the writable side ended,
2657
- // then we're ok.
2658
- if (this.allowHalfOpen || this._writableState.ended)
2659
- return;
2660
-
2661
- // no more data can be written.
2662
- // But allow more writes to happen in this tick.
2663
- var self = this;
2664
- setImmediate(function () {
2665
- self.end();
2666
- });
2667
- }
2668
-
2669
- },{"./readable.js":14,"./writable.js":16,"inherits":19,"process/browser.js":12}],11:[function(require,module,exports){
2670
- // Copyright Joyent, Inc. and other Node contributors.
2671
- //
2672
- // Permission is hereby granted, free of charge, to any person obtaining a
2673
- // copy of this software and associated documentation files (the
2674
- // "Software"), to deal in the Software without restriction, including
2675
- // without limitation the rights to use, copy, modify, merge, publish,
2676
- // distribute, sublicense, and/or sell copies of the Software, and to permit
2677
- // persons to whom the Software is furnished to do so, subject to the
2678
- // following conditions:
2679
- //
2680
- // The above copyright notice and this permission notice shall be included
2681
- // in all copies or substantial portions of the Software.
2682
- //
2683
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2684
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2685
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2686
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2687
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2688
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2689
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
2690
-
2691
- module.exports = Stream;
2692
-
2693
- var EE = require('events').EventEmitter;
2694
- var inherits = require('inherits');
2695
-
2696
- inherits(Stream, EE);
2697
- Stream.Readable = require('./readable.js');
2698
- Stream.Writable = require('./writable.js');
2699
- Stream.Duplex = require('./duplex.js');
2700
- Stream.Transform = require('./transform.js');
2701
- Stream.PassThrough = require('./passthrough.js');
2702
-
2703
- // Backwards-compat with node 0.4.x
2704
- Stream.Stream = Stream;
2705
-
2706
-
2707
-
2708
- // old-style streams. Note that the pipe method (the only relevant
2709
- // part of this class) is overridden in the Readable class.
2710
-
2711
- function Stream() {
2712
- EE.call(this);
2713
- }
2714
-
2715
- Stream.prototype.pipe = function(dest, options) {
2716
- var source = this;
2717
-
2718
- function ondata(chunk) {
2719
- if (dest.writable) {
2720
- if (false === dest.write(chunk) && source.pause) {
2721
- source.pause();
2722
- }
2723
- }
2724
- }
2725
-
2726
- source.on('data', ondata);
2727
-
2728
- function ondrain() {
2729
- if (source.readable && source.resume) {
2730
- source.resume();
2731
- }
2732
- }
2733
-
2734
- dest.on('drain', ondrain);
2735
-
2736
- // If the 'end' option is not supplied, dest.end() will be called when
2737
- // source gets the 'end' or 'close' events. Only dest.end() once.
2738
- if (!dest._isStdio && (!options || options.end !== false)) {
2739
- source.on('end', onend);
2740
- source.on('close', onclose);
2741
- }
2742
-
2743
- var didOnEnd = false;
2744
- function onend() {
2745
- if (didOnEnd) return;
2746
- didOnEnd = true;
2747
-
2748
- dest.end();
2749
- }
2750
-
2751
-
2752
- function onclose() {
2753
- if (didOnEnd) return;
2754
- didOnEnd = true;
2755
-
2756
- if (typeof dest.destroy === 'function') dest.destroy();
2757
- }
2758
-
2759
- // don't leave dangling pipes when there are errors.
2760
- function onerror(er) {
2761
- cleanup();
2762
- if (EE.listenerCount(this, 'error') === 0) {
2763
- throw er; // Unhandled stream error in pipe.
2764
- }
2765
- }
2766
-
2767
- source.on('error', onerror);
2768
- dest.on('error', onerror);
2769
-
2770
- // remove all the event listeners that were added.
2771
- function cleanup() {
2772
- source.removeListener('data', ondata);
2773
- dest.removeListener('drain', ondrain);
2774
-
2775
- source.removeListener('end', onend);
2776
- source.removeListener('close', onclose);
2777
-
2778
- source.removeListener('error', onerror);
2779
- dest.removeListener('error', onerror);
2780
-
2781
- source.removeListener('end', cleanup);
2782
- source.removeListener('close', cleanup);
2783
-
2784
- dest.removeListener('close', cleanup);
2785
- }
2786
-
2787
- source.on('end', cleanup);
2788
- source.on('close', cleanup);
2789
-
2790
- dest.on('close', cleanup);
2791
-
2792
- dest.emit('pipe', source);
2793
-
2794
- // Allow for unix-like usage: A.pipe(B).pipe(C)
2795
- return dest;
2796
- };
2797
-
2798
- },{"./duplex.js":10,"./passthrough.js":13,"./readable.js":14,"./transform.js":15,"./writable.js":16,"events":8,"inherits":19}],12:[function(require,module,exports){
2799
- // shim for using process in browser
2800
-
2801
- var process = module.exports = {};
2802
-
2803
- process.nextTick = (function () {
2804
- var canSetImmediate = typeof window !== 'undefined'
2805
- && window.setImmediate;
2806
- var canPost = typeof window !== 'undefined'
2807
- && window.postMessage && window.addEventListener
2808
- ;
2809
-
2810
- if (canSetImmediate) {
2811
- return function (f) { return window.setImmediate(f) };
2812
- }
2813
-
2814
- if (canPost) {
2815
- var queue = [];
2816
- window.addEventListener('message', function (ev) {
2817
- var source = ev.source;
2818
- if ((source === window || source === null) && ev.data === 'process-tick') {
2819
- ev.stopPropagation();
2820
- if (queue.length > 0) {
2821
- var fn = queue.shift();
2822
- fn();
2823
- }
2824
- }
2825
- }, true);
2826
-
2827
- return function nextTick(fn) {
2828
- queue.push(fn);
2829
- window.postMessage('process-tick', '*');
2830
- };
2831
- }
2832
-
2833
- return function nextTick(fn) {
2834
- setTimeout(fn, 0);
2835
- };
2836
- })();
2837
-
2838
- process.title = 'browser';
2839
- process.browser = true;
2840
- process.env = {};
2841
- process.argv = [];
2842
-
2843
- process.binding = function (name) {
2844
- throw new Error('process.binding is not supported');
2845
- }
2846
-
2847
- // TODO(shtylman)
2848
- process.cwd = function () { return '/' };
2849
- process.chdir = function (dir) {
2850
- throw new Error('process.chdir is not supported');
2851
- };
2852
-
2853
- },{}],13:[function(require,module,exports){
2854
- // Copyright Joyent, Inc. and other Node contributors.
2855
- //
2856
- // Permission is hereby granted, free of charge, to any person obtaining a
2857
- // copy of this software and associated documentation files (the
2858
- // "Software"), to deal in the Software without restriction, including
2859
- // without limitation the rights to use, copy, modify, merge, publish,
2860
- // distribute, sublicense, and/or sell copies of the Software, and to permit
2861
- // persons to whom the Software is furnished to do so, subject to the
2862
- // following conditions:
2863
- //
2864
- // The above copyright notice and this permission notice shall be included
2865
- // in all copies or substantial portions of the Software.
2866
- //
2867
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2868
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2869
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2870
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2871
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2872
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2873
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
2874
-
2875
- // a passthrough stream.
2876
- // basically just the most minimal sort of Transform stream.
2877
- // Every written chunk gets output as-is.
2878
-
2879
- module.exports = PassThrough;
2880
-
2881
- var Transform = require('./transform.js');
2882
- var inherits = require('inherits');
2883
- inherits(PassThrough, Transform);
2884
-
2885
- function PassThrough(options) {
2886
- if (!(this instanceof PassThrough))
2887
- return new PassThrough(options);
2888
-
2889
- Transform.call(this, options);
2890
- }
2891
-
2892
- PassThrough.prototype._transform = function(chunk, encoding, cb) {
2893
- cb(null, chunk);
2894
- };
2895
-
2896
- },{"./transform.js":15,"inherits":19}],14:[function(require,module,exports){
2897
- (function (process){
2898
- // Copyright Joyent, Inc. and other Node contributors.
2899
- //
2900
- // Permission is hereby granted, free of charge, to any person obtaining a
2901
- // copy of this software and associated documentation files (the
2902
- // "Software"), to deal in the Software without restriction, including
2903
- // without limitation the rights to use, copy, modify, merge, publish,
2904
- // distribute, sublicense, and/or sell copies of the Software, and to permit
2905
- // persons to whom the Software is furnished to do so, subject to the
2906
- // following conditions:
2907
- //
2908
- // The above copyright notice and this permission notice shall be included
2909
- // in all copies or substantial portions of the Software.
2910
- //
2911
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2912
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2913
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2914
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2915
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2916
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2917
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
2918
-
2919
- module.exports = Readable;
2920
- Readable.ReadableState = ReadableState;
2921
-
2922
- var EE = require('events').EventEmitter;
2923
- var Stream = require('./index.js');
2924
- var Buffer = require('buffer').Buffer;
2925
- var setImmediate = require('process/browser.js').nextTick;
2926
- var StringDecoder;
2927
-
2928
- var inherits = require('inherits');
2929
- inherits(Readable, Stream);
2930
-
2931
- function ReadableState(options, stream) {
2932
- options = options || {};
2933
-
2934
- // the point at which it stops calling _read() to fill the buffer
2935
- // Note: 0 is a valid value, means "don't call _read preemptively ever"
2936
- var hwm = options.highWaterMark;
2937
- this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024;
2938
-
2939
- // cast to ints.
2940
- this.highWaterMark = ~~this.highWaterMark;
2941
-
2942
- this.buffer = [];
2943
- this.length = 0;
2944
- this.pipes = null;
2945
- this.pipesCount = 0;
2946
- this.flowing = false;
2947
- this.ended = false;
2948
- this.endEmitted = false;
2949
- this.reading = false;
2950
-
2951
- // In streams that never have any data, and do push(null) right away,
2952
- // the consumer can miss the 'end' event if they do some I/O before
2953
- // consuming the stream. So, we don't emit('end') until some reading
2954
- // happens.
2955
- this.calledRead = false;
2956
-
2957
- // a flag to be able to tell if the onwrite cb is called immediately,
2958
- // or on a later tick. We set this to true at first, becuase any
2959
- // actions that shouldn't happen until "later" should generally also
2960
- // not happen before the first write call.
2961
- this.sync = true;
2962
-
2963
- // whenever we return null, then we set a flag to say
2964
- // that we're awaiting a 'readable' event emission.
2965
- this.needReadable = false;
2966
- this.emittedReadable = false;
2967
- this.readableListening = false;
2968
-
2969
-
2970
- // object stream flag. Used to make read(n) ignore n and to
2971
- // make all the buffer merging and length checks go away
2972
- this.objectMode = !!options.objectMode;
2973
-
2974
- // Crypto is kind of old and crusty. Historically, its default string
2975
- // encoding is 'binary' so we have to make this configurable.
2976
- // Everything else in the universe uses 'utf8', though.
2977
- this.defaultEncoding = options.defaultEncoding || 'utf8';
2978
-
2979
- // when piping, we only care about 'readable' events that happen
2980
- // after read()ing all the bytes and not getting any pushback.
2981
- this.ranOut = false;
2982
-
2983
- // the number of writers that are awaiting a drain event in .pipe()s
2984
- this.awaitDrain = 0;
2985
-
2986
- // if true, a maybeReadMore has been scheduled
2987
- this.readingMore = false;
2988
-
2989
- this.decoder = null;
2990
- this.encoding = null;
2991
- if (options.encoding) {
2992
- if (!StringDecoder)
2993
- StringDecoder = require('string_decoder').StringDecoder;
2994
- this.decoder = new StringDecoder(options.encoding);
2995
- this.encoding = options.encoding;
2996
- }
2997
- }
2998
-
2999
- function Readable(options) {
3000
- if (!(this instanceof Readable))
3001
- return new Readable(options);
3002
-
3003
- this._readableState = new ReadableState(options, this);
3004
-
3005
- // legacy
3006
- this.readable = true;
3007
-
3008
- Stream.call(this);
3009
- }
3010
-
3011
- // Manually shove something into the read() buffer.
3012
- // This returns true if the highWaterMark has not been hit yet,
3013
- // similar to how Writable.write() returns true if you should
3014
- // write() some more.
3015
- Readable.prototype.push = function(chunk, encoding) {
3016
- var state = this._readableState;
3017
-
3018
- if (typeof chunk === 'string' && !state.objectMode) {
3019
- encoding = encoding || state.defaultEncoding;
3020
- if (encoding !== state.encoding) {
3021
- chunk = new Buffer(chunk, encoding);
3022
- encoding = '';
3023
- }
3024
- }
3025
-
3026
- return readableAddChunk(this, state, chunk, encoding, false);
3027
- };
3028
-
3029
- // Unshift should *always* be something directly out of read()
3030
- Readable.prototype.unshift = function(chunk) {
3031
- var state = this._readableState;
3032
- return readableAddChunk(this, state, chunk, '', true);
3033
- };
3034
-
3035
- function readableAddChunk(stream, state, chunk, encoding, addToFront) {
3036
- var er = chunkInvalid(state, chunk);
3037
- if (er) {
3038
- stream.emit('error', er);
3039
- } else if (chunk === null || chunk === undefined) {
3040
- state.reading = false;
3041
- if (!state.ended)
3042
- onEofChunk(stream, state);
3043
- } else if (state.objectMode || chunk && chunk.length > 0) {
3044
- if (state.ended && !addToFront) {
3045
- var e = new Error('stream.push() after EOF');
3046
- stream.emit('error', e);
3047
- } else if (state.endEmitted && addToFront) {
3048
- var e = new Error('stream.unshift() after end event');
3049
- stream.emit('error', e);
3050
- } else {
3051
- if (state.decoder && !addToFront && !encoding)
3052
- chunk = state.decoder.write(chunk);
3053
-
3054
- // update the buffer info.
3055
- state.length += state.objectMode ? 1 : chunk.length;
3056
- if (addToFront) {
3057
- state.buffer.unshift(chunk);
3058
- } else {
3059
- state.reading = false;
3060
- state.buffer.push(chunk);
3061
- }
3062
-
3063
- if (state.needReadable)
3064
- emitReadable(stream);
3065
-
3066
- maybeReadMore(stream, state);
3067
- }
3068
- } else if (!addToFront) {
3069
- state.reading = false;
3070
- }
3071
-
3072
- return needMoreData(state);
3073
- }
3074
-
3075
-
3076
-
3077
- // if it's past the high water mark, we can push in some more.
3078
- // Also, if we have no data yet, we can stand some
3079
- // more bytes. This is to work around cases where hwm=0,
3080
- // such as the repl. Also, if the push() triggered a
3081
- // readable event, and the user called read(largeNumber) such that
3082
- // needReadable was set, then we ought to push more, so that another
3083
- // 'readable' event will be triggered.
3084
- function needMoreData(state) {
3085
- return !state.ended &&
3086
- (state.needReadable ||
3087
- state.length < state.highWaterMark ||
3088
- state.length === 0);
3089
- }
3090
-
3091
- // backwards compatibility.
3092
- Readable.prototype.setEncoding = function(enc) {
3093
- if (!StringDecoder)
3094
- StringDecoder = require('string_decoder').StringDecoder;
3095
- this._readableState.decoder = new StringDecoder(enc);
3096
- this._readableState.encoding = enc;
3097
- };
3098
-
3099
- // Don't raise the hwm > 128MB
3100
- var MAX_HWM = 0x800000;
3101
- function roundUpToNextPowerOf2(n) {
3102
- if (n >= MAX_HWM) {
3103
- n = MAX_HWM;
3104
- } else {
3105
- // Get the next highest power of 2
3106
- n--;
3107
- for (var p = 1; p < 32; p <<= 1) n |= n >> p;
3108
- n++;
3109
- }
3110
- return n;
3111
- }
3112
-
3113
- function howMuchToRead(n, state) {
3114
- if (state.length === 0 && state.ended)
3115
- return 0;
3116
-
3117
- if (state.objectMode)
3118
- return n === 0 ? 0 : 1;
3119
-
3120
- if (isNaN(n) || n === null) {
3121
- // only flow one buffer at a time
3122
- if (state.flowing && state.buffer.length)
3123
- return state.buffer[0].length;
3124
- else
3125
- return state.length;
3126
- }
3127
-
3128
- if (n <= 0)
3129
- return 0;
3130
-
3131
- // If we're asking for more than the target buffer level,
3132
- // then raise the water mark. Bump up to the next highest
3133
- // power of 2, to prevent increasing it excessively in tiny
3134
- // amounts.
3135
- if (n > state.highWaterMark)
3136
- state.highWaterMark = roundUpToNextPowerOf2(n);
3137
-
3138
- // don't have that much. return null, unless we've ended.
3139
- if (n > state.length) {
3140
- if (!state.ended) {
3141
- state.needReadable = true;
3142
- return 0;
3143
- } else
3144
- return state.length;
3145
- }
3146
-
3147
- return n;
3148
- }
3149
-
3150
- // you can override either this method, or the async _read(n) below.
3151
- Readable.prototype.read = function(n) {
3152
- var state = this._readableState;
3153
- state.calledRead = true;
3154
- var nOrig = n;
3155
-
3156
- if (typeof n !== 'number' || n > 0)
3157
- state.emittedReadable = false;
3158
-
3159
- // if we're doing read(0) to trigger a readable event, but we
3160
- // already have a bunch of data in the buffer, then just trigger
3161
- // the 'readable' event and move on.
3162
- if (n === 0 &&
3163
- state.needReadable &&
3164
- (state.length >= state.highWaterMark || state.ended)) {
3165
- emitReadable(this);
3166
- return null;
3167
- }
3168
-
3169
- n = howMuchToRead(n, state);
3170
-
3171
- // if we've ended, and we're now clear, then finish it up.
3172
- if (n === 0 && state.ended) {
3173
- if (state.length === 0)
3174
- endReadable(this);
3175
- return null;
3176
- }
3177
-
3178
- // All the actual chunk generation logic needs to be
3179
- // *below* the call to _read. The reason is that in certain
3180
- // synthetic stream cases, such as passthrough streams, _read
3181
- // may be a completely synchronous operation which may change
3182
- // the state of the read buffer, providing enough data when
3183
- // before there was *not* enough.
3184
- //
3185
- // So, the steps are:
3186
- // 1. Figure out what the state of things will be after we do
3187
- // a read from the buffer.
3188
- //
3189
- // 2. If that resulting state will trigger a _read, then call _read.
3190
- // Note that this may be asynchronous, or synchronous. Yes, it is
3191
- // deeply ugly to write APIs this way, but that still doesn't mean
3192
- // that the Readable class should behave improperly, as streams are
3193
- // designed to be sync/async agnostic.
3194
- // Take note if the _read call is sync or async (ie, if the read call
3195
- // has returned yet), so that we know whether or not it's safe to emit
3196
- // 'readable' etc.
3197
- //
3198
- // 3. Actually pull the requested chunks out of the buffer and return.
3199
-
3200
- // if we need a readable event, then we need to do some reading.
3201
- var doRead = state.needReadable;
3202
-
3203
- // if we currently have less than the highWaterMark, then also read some
3204
- if (state.length - n <= state.highWaterMark)
3205
- doRead = true;
3206
-
3207
- // however, if we've ended, then there's no point, and if we're already
3208
- // reading, then it's unnecessary.
3209
- if (state.ended || state.reading)
3210
- doRead = false;
3211
-
3212
- if (doRead) {
3213
- state.reading = true;
3214
- state.sync = true;
3215
- // if the length is currently zero, then we *need* a readable event.
3216
- if (state.length === 0)
3217
- state.needReadable = true;
3218
- // call internal read method
3219
- this._read(state.highWaterMark);
3220
- state.sync = false;
3221
- }
3222
-
3223
- // If _read called its callback synchronously, then `reading`
3224
- // will be false, and we need to re-evaluate how much data we
3225
- // can return to the user.
3226
- if (doRead && !state.reading)
3227
- n = howMuchToRead(nOrig, state);
3228
-
3229
- var ret;
3230
- if (n > 0)
3231
- ret = fromList(n, state);
3232
- else
3233
- ret = null;
3234
-
3235
- if (ret === null) {
3236
- state.needReadable = true;
3237
- n = 0;
3238
- }
3239
-
3240
- state.length -= n;
3241
-
3242
- // If we have nothing in the buffer, then we want to know
3243
- // as soon as we *do* get something into the buffer.
3244
- if (state.length === 0 && !state.ended)
3245
- state.needReadable = true;
3246
-
3247
- // If we happened to read() exactly the remaining amount in the
3248
- // buffer, and the EOF has been seen at this point, then make sure
3249
- // that we emit 'end' on the very next tick.
3250
- if (state.ended && !state.endEmitted && state.length === 0)
3251
- endReadable(this);
3252
-
3253
- return ret;
3254
- };
3255
-
3256
- function chunkInvalid(state, chunk) {
3257
- var er = null;
3258
- if (!Buffer.isBuffer(chunk) &&
3259
- 'string' !== typeof chunk &&
3260
- chunk !== null &&
3261
- chunk !== undefined &&
3262
- !state.objectMode &&
3263
- !er) {
3264
- er = new TypeError('Invalid non-string/buffer chunk');
3265
- }
3266
- return er;
3267
- }
3268
-
3269
-
3270
- function onEofChunk(stream, state) {
3271
- if (state.decoder && !state.ended) {
3272
- var chunk = state.decoder.end();
3273
- if (chunk && chunk.length) {
3274
- state.buffer.push(chunk);
3275
- state.length += state.objectMode ? 1 : chunk.length;
3276
- }
3277
- }
3278
- state.ended = true;
3279
-
3280
- // if we've ended and we have some data left, then emit
3281
- // 'readable' now to make sure it gets picked up.
3282
- if (state.length > 0)
3283
- emitReadable(stream);
3284
- else
3285
- endReadable(stream);
3286
- }
3287
-
3288
- // Don't emit readable right away in sync mode, because this can trigger
3289
- // another read() call => stack overflow. This way, it might trigger
3290
- // a nextTick recursion warning, but that's not so bad.
3291
- function emitReadable(stream) {
3292
- var state = stream._readableState;
3293
- state.needReadable = false;
3294
- if (state.emittedReadable)
3295
- return;
3296
-
3297
- state.emittedReadable = true;
3298
- if (state.sync)
3299
- setImmediate(function() {
3300
- emitReadable_(stream);
3301
- });
3302
- else
3303
- emitReadable_(stream);
3304
- }
3305
-
3306
- function emitReadable_(stream) {
3307
- stream.emit('readable');
3308
- }
3309
-
3310
-
3311
- // at this point, the user has presumably seen the 'readable' event,
3312
- // and called read() to consume some data. that may have triggered
3313
- // in turn another _read(n) call, in which case reading = true if
3314
- // it's in progress.
3315
- // However, if we're not ended, or reading, and the length < hwm,
3316
- // then go ahead and try to read some more preemptively.
3317
- function maybeReadMore(stream, state) {
3318
- if (!state.readingMore) {
3319
- state.readingMore = true;
3320
- setImmediate(function() {
3321
- maybeReadMore_(stream, state);
3322
- });
3323
- }
3324
- }
3325
-
3326
- function maybeReadMore_(stream, state) {
3327
- var len = state.length;
3328
- while (!state.reading && !state.flowing && !state.ended &&
3329
- state.length < state.highWaterMark) {
3330
- stream.read(0);
3331
- if (len === state.length)
3332
- // didn't get any data, stop spinning.
3333
- break;
3334
- else
3335
- len = state.length;
3336
- }
3337
- state.readingMore = false;
3338
- }
3339
-
3340
- // abstract method. to be overridden in specific implementation classes.
3341
- // call cb(er, data) where data is <= n in length.
3342
- // for virtual (non-string, non-buffer) streams, "length" is somewhat
3343
- // arbitrary, and perhaps not very meaningful.
3344
- Readable.prototype._read = function(n) {
3345
- this.emit('error', new Error('not implemented'));
3346
- };
3347
-
3348
- Readable.prototype.pipe = function(dest, pipeOpts) {
3349
- var src = this;
3350
- var state = this._readableState;
3351
-
3352
- switch (state.pipesCount) {
3353
- case 0:
3354
- state.pipes = dest;
3355
- break;
3356
- case 1:
3357
- state.pipes = [state.pipes, dest];
3358
- break;
3359
- default:
3360
- state.pipes.push(dest);
3361
- break;
3362
- }
3363
- state.pipesCount += 1;
3364
-
3365
- var doEnd = (!pipeOpts || pipeOpts.end !== false) &&
3366
- dest !== process.stdout &&
3367
- dest !== process.stderr;
3368
-
3369
- var endFn = doEnd ? onend : cleanup;
3370
- if (state.endEmitted)
3371
- setImmediate(endFn);
3372
- else
3373
- src.once('end', endFn);
3374
-
3375
- dest.on('unpipe', onunpipe);
3376
- function onunpipe(readable) {
3377
- if (readable !== src) return;
3378
- cleanup();
3379
- }
3380
-
3381
- function onend() {
3382
- dest.end();
3383
- }
3384
-
3385
- // when the dest drains, it reduces the awaitDrain counter
3386
- // on the source. This would be more elegant with a .once()
3387
- // handler in flow(), but adding and removing repeatedly is
3388
- // too slow.
3389
- var ondrain = pipeOnDrain(src);
3390
- dest.on('drain', ondrain);
3391
-
3392
- function cleanup() {
3393
- // cleanup event handlers once the pipe is broken
3394
- dest.removeListener('close', onclose);
3395
- dest.removeListener('finish', onfinish);
3396
- dest.removeListener('drain', ondrain);
3397
- dest.removeListener('error', onerror);
3398
- dest.removeListener('unpipe', onunpipe);
3399
- src.removeListener('end', onend);
3400
- src.removeListener('end', cleanup);
3401
-
3402
- // if the reader is waiting for a drain event from this
3403
- // specific writer, then it would cause it to never start
3404
- // flowing again.
3405
- // So, if this is awaiting a drain, then we just call it now.
3406
- // If we don't know, then assume that we are waiting for one.
3407
- if (!dest._writableState || dest._writableState.needDrain)
3408
- ondrain();
3409
- }
3410
-
3411
- // if the dest has an error, then stop piping into it.
3412
- // however, don't suppress the throwing behavior for this.
3413
- // check for listeners before emit removes one-time listeners.
3414
- var errListeners = EE.listenerCount(dest, 'error');
3415
- function onerror(er) {
3416
- unpipe();
3417
- if (errListeners === 0 && EE.listenerCount(dest, 'error') === 0)
3418
- dest.emit('error', er);
3419
- }
3420
- dest.once('error', onerror);
3421
-
3422
- // Both close and finish should trigger unpipe, but only once.
3423
- function onclose() {
3424
- dest.removeListener('finish', onfinish);
3425
- unpipe();
3426
- }
3427
- dest.once('close', onclose);
3428
- function onfinish() {
3429
- dest.removeListener('close', onclose);
3430
- unpipe();
3431
- }
3432
- dest.once('finish', onfinish);
3433
-
3434
- function unpipe() {
3435
- src.unpipe(dest);
3436
- }
3437
-
3438
- // tell the dest that it's being piped to
3439
- dest.emit('pipe', src);
3440
-
3441
- // start the flow if it hasn't been started already.
3442
- if (!state.flowing) {
3443
- // the handler that waits for readable events after all
3444
- // the data gets sucked out in flow.
3445
- // This would be easier to follow with a .once() handler
3446
- // in flow(), but that is too slow.
3447
- this.on('readable', pipeOnReadable);
3448
-
3449
- state.flowing = true;
3450
- setImmediate(function() {
3451
- flow(src);
3452
- });
3453
- }
3454
-
3455
- return dest;
3456
- };
3457
-
3458
- function pipeOnDrain(src) {
3459
- return function() {
3460
- var dest = this;
3461
- var state = src._readableState;
3462
- state.awaitDrain--;
3463
- if (state.awaitDrain === 0)
3464
- flow(src);
3465
- };
3466
- }
3467
-
3468
- function flow(src) {
3469
- var state = src._readableState;
3470
- var chunk;
3471
- state.awaitDrain = 0;
3472
-
3473
- function write(dest, i, list) {
3474
- var written = dest.write(chunk);
3475
- if (false === written) {
3476
- state.awaitDrain++;
3477
- }
3478
- }
3479
-
3480
- while (state.pipesCount && null !== (chunk = src.read())) {
3481
-
3482
- if (state.pipesCount === 1)
3483
- write(state.pipes, 0, null);
3484
- else
3485
- forEach(state.pipes, write);
3486
-
3487
- src.emit('data', chunk);
3488
-
3489
- // if anyone needs a drain, then we have to wait for that.
3490
- if (state.awaitDrain > 0)
3491
- return;
3492
- }
3493
-
3494
- // if every destination was unpiped, either before entering this
3495
- // function, or in the while loop, then stop flowing.
3496
- //
3497
- // NB: This is a pretty rare edge case.
3498
- if (state.pipesCount === 0) {
3499
- state.flowing = false;
3500
-
3501
- // if there were data event listeners added, then switch to old mode.
3502
- if (EE.listenerCount(src, 'data') > 0)
3503
- emitDataEvents(src);
3504
- return;
3505
- }
3506
-
3507
- // at this point, no one needed a drain, so we just ran out of data
3508
- // on the next readable event, start it over again.
3509
- state.ranOut = true;
3510
- }
3511
-
3512
- function pipeOnReadable() {
3513
- if (this._readableState.ranOut) {
3514
- this._readableState.ranOut = false;
3515
- flow(this);
3516
- }
3517
- }
3518
-
3519
-
3520
- Readable.prototype.unpipe = function(dest) {
3521
- var state = this._readableState;
3522
-
3523
- // if we're not piping anywhere, then do nothing.
3524
- if (state.pipesCount === 0)
3525
- return this;
3526
-
3527
- // just one destination. most common case.
3528
- if (state.pipesCount === 1) {
3529
- // passed in one, but it's not the right one.
3530
- if (dest && dest !== state.pipes)
3531
- return this;
3532
-
3533
- if (!dest)
3534
- dest = state.pipes;
3535
-
3536
- // got a match.
3537
- state.pipes = null;
3538
- state.pipesCount = 0;
3539
- this.removeListener('readable', pipeOnReadable);
3540
- state.flowing = false;
3541
- if (dest)
3542
- dest.emit('unpipe', this);
3543
- return this;
3544
- }
3545
-
3546
- // slow case. multiple pipe destinations.
3547
-
3548
- if (!dest) {
3549
- // remove all.
3550
- var dests = state.pipes;
3551
- var len = state.pipesCount;
3552
- state.pipes = null;
3553
- state.pipesCount = 0;
3554
- this.removeListener('readable', pipeOnReadable);
3555
- state.flowing = false;
3556
-
3557
- for (var i = 0; i < len; i++)
3558
- dests[i].emit('unpipe', this);
3559
- return this;
3560
- }
3561
-
3562
- // try to find the right one.
3563
- var i = indexOf(state.pipes, dest);
3564
- if (i === -1)
3565
- return this;
3566
-
3567
- state.pipes.splice(i, 1);
3568
- state.pipesCount -= 1;
3569
- if (state.pipesCount === 1)
3570
- state.pipes = state.pipes[0];
3571
-
3572
- dest.emit('unpipe', this);
3573
-
3574
- return this;
3575
- };
3576
-
3577
- // set up data events if they are asked for
3578
- // Ensure readable listeners eventually get something
3579
- Readable.prototype.on = function(ev, fn) {
3580
- var res = Stream.prototype.on.call(this, ev, fn);
3581
-
3582
- if (ev === 'data' && !this._readableState.flowing)
3583
- emitDataEvents(this);
3584
-
3585
- if (ev === 'readable' && this.readable) {
3586
- var state = this._readableState;
3587
- if (!state.readableListening) {
3588
- state.readableListening = true;
3589
- state.emittedReadable = false;
3590
- state.needReadable = true;
3591
- if (!state.reading) {
3592
- this.read(0);
3593
- } else if (state.length) {
3594
- emitReadable(this, state);
3595
- }
3596
- }
3597
- }
3598
-
3599
- return res;
3600
- };
3601
- Readable.prototype.addListener = Readable.prototype.on;
3602
-
3603
- // pause() and resume() are remnants of the legacy readable stream API
3604
- // If the user uses them, then switch into old mode.
3605
- Readable.prototype.resume = function() {
3606
- emitDataEvents(this);
3607
- this.read(0);
3608
- this.emit('resume');
3609
- };
3610
-
3611
- Readable.prototype.pause = function() {
3612
- emitDataEvents(this, true);
3613
- this.emit('pause');
3614
- };
3615
-
3616
- function emitDataEvents(stream, startPaused) {
3617
- var state = stream._readableState;
3618
-
3619
- if (state.flowing) {
3620
- // https://github.com/isaacs/readable-stream/issues/16
3621
- throw new Error('Cannot switch to old mode now.');
3622
- }
3623
-
3624
- var paused = startPaused || false;
3625
- var readable = false;
3626
-
3627
- // convert to an old-style stream.
3628
- stream.readable = true;
3629
- stream.pipe = Stream.prototype.pipe;
3630
- stream.on = stream.addListener = Stream.prototype.on;
3631
-
3632
- stream.on('readable', function() {
3633
- readable = true;
3634
-
3635
- var c;
3636
- while (!paused && (null !== (c = stream.read())))
3637
- stream.emit('data', c);
3638
-
3639
- if (c === null) {
3640
- readable = false;
3641
- stream._readableState.needReadable = true;
3642
- }
3643
- });
3644
-
3645
- stream.pause = function() {
3646
- paused = true;
3647
- this.emit('pause');
3648
- };
3649
-
3650
- stream.resume = function() {
3651
- paused = false;
3652
- if (readable)
3653
- setImmediate(function() {
3654
- stream.emit('readable');
3655
- });
3656
- else
3657
- this.read(0);
3658
- this.emit('resume');
3659
- };
3660
-
3661
- // now make it start, just in case it hadn't already.
3662
- stream.emit('readable');
3663
- }
3664
-
3665
- // wrap an old-style stream as the async data source.
3666
- // This is *not* part of the readable stream interface.
3667
- // It is an ugly unfortunate mess of history.
3668
- Readable.prototype.wrap = function(stream) {
3669
- var state = this._readableState;
3670
- var paused = false;
3671
-
3672
- var self = this;
3673
- stream.on('end', function() {
3674
- if (state.decoder && !state.ended) {
3675
- var chunk = state.decoder.end();
3676
- if (chunk && chunk.length)
3677
- self.push(chunk);
3678
- }
3679
-
3680
- self.push(null);
3681
- });
3682
-
3683
- stream.on('data', function(chunk) {
3684
- if (state.decoder)
3685
- chunk = state.decoder.write(chunk);
3686
- if (!chunk || !state.objectMode && !chunk.length)
3687
- return;
3688
-
3689
- var ret = self.push(chunk);
3690
- if (!ret) {
3691
- paused = true;
3692
- stream.pause();
3693
- }
3694
- });
3695
-
3696
- // proxy all the other methods.
3697
- // important when wrapping filters and duplexes.
3698
- for (var i in stream) {
3699
- if (typeof stream[i] === 'function' &&
3700
- typeof this[i] === 'undefined') {
3701
- this[i] = function(method) { return function() {
3702
- return stream[method].apply(stream, arguments);
3703
- }}(i);
3704
- }
3705
- }
3706
-
3707
- // proxy certain important events.
3708
- var events = ['error', 'close', 'destroy', 'pause', 'resume'];
3709
- forEach(events, function(ev) {
3710
- stream.on(ev, function (x) {
3711
- return self.emit.apply(self, ev, x);
3712
- });
3713
- });
3714
-
3715
- // when we try to consume some more bytes, simply unpause the
3716
- // underlying stream.
3717
- self._read = function(n) {
3718
- if (paused) {
3719
- paused = false;
3720
- stream.resume();
3721
- }
3722
- };
3723
-
3724
- return self;
3725
- };
3726
-
3727
-
3728
-
3729
- // exposed for testing purposes only.
3730
- Readable._fromList = fromList;
3731
-
3732
- // Pluck off n bytes from an array of buffers.
3733
- // Length is the combined lengths of all the buffers in the list.
3734
- function fromList(n, state) {
3735
- var list = state.buffer;
3736
- var length = state.length;
3737
- var stringMode = !!state.decoder;
3738
- var objectMode = !!state.objectMode;
3739
- var ret;
3740
-
3741
- // nothing in the list, definitely empty.
3742
- if (list.length === 0)
3743
- return null;
3744
-
3745
- if (length === 0)
3746
- ret = null;
3747
- else if (objectMode)
3748
- ret = list.shift();
3749
- else if (!n || n >= length) {
3750
- // read it all, truncate the array.
3751
- if (stringMode)
3752
- ret = list.join('');
3753
- else
3754
- ret = Buffer.concat(list, length);
3755
- list.length = 0;
3756
- } else {
3757
- // read just some of it.
3758
- if (n < list[0].length) {
3759
- // just take a part of the first list item.
3760
- // slice is the same for buffers and strings.
3761
- var buf = list[0];
3762
- ret = buf.slice(0, n);
3763
- list[0] = buf.slice(n);
3764
- } else if (n === list[0].length) {
3765
- // first list is a perfect match
3766
- ret = list.shift();
3767
- } else {
3768
- // complex case.
3769
- // we have enough to cover it, but it spans past the first buffer.
3770
- if (stringMode)
3771
- ret = '';
3772
- else
3773
- ret = new Buffer(n);
3774
-
3775
- var c = 0;
3776
- for (var i = 0, l = list.length; i < l && c < n; i++) {
3777
- var buf = list[0];
3778
- var cpy = Math.min(n - c, buf.length);
3779
-
3780
- if (stringMode)
3781
- ret += buf.slice(0, cpy);
3782
- else
3783
- buf.copy(ret, c, 0, cpy);
3784
-
3785
- if (cpy < buf.length)
3786
- list[0] = buf.slice(cpy);
3787
- else
3788
- list.shift();
3789
-
3790
- c += cpy;
3791
- }
3792
- }
3793
- }
3794
-
3795
- return ret;
3796
- }
3797
-
3798
- function endReadable(stream) {
3799
- var state = stream._readableState;
3800
-
3801
- // If we get here before consuming all the bytes, then that is a
3802
- // bug in node. Should never happen.
3803
- if (state.length > 0)
3804
- throw new Error('endReadable called on non-empty stream');
3805
-
3806
- if (!state.endEmitted && state.calledRead) {
3807
- state.ended = true;
3808
- setImmediate(function() {
3809
- // Check that we didn't get one last unshift.
3810
- if (!state.endEmitted && state.length === 0) {
3811
- state.endEmitted = true;
3812
- stream.readable = false;
3813
- stream.emit('end');
3814
- }
3815
- });
3816
- }
3817
- }
3818
-
3819
- function forEach (xs, f) {
3820
- for (var i = 0, l = xs.length; i < l; i++) {
3821
- f(xs[i], i);
3822
- }
3823
- }
3824
-
3825
- function indexOf (xs, x) {
3826
- for (var i = 0, l = xs.length; i < l; i++) {
3827
- if (xs[i] === x) return i;
3828
- }
3829
- return -1;
3830
- }
3831
-
3832
- }).call(this,require("7YKIPe"))
3833
- },{"./index.js":11,"7YKIPe":9,"buffer":7,"events":8,"inherits":19,"process/browser.js":12,"string_decoder":17}],15:[function(require,module,exports){
3834
- // Copyright Joyent, Inc. and other Node contributors.
3835
- //
3836
- // Permission is hereby granted, free of charge, to any person obtaining a
3837
- // copy of this software and associated documentation files (the
3838
- // "Software"), to deal in the Software without restriction, including
3839
- // without limitation the rights to use, copy, modify, merge, publish,
3840
- // distribute, sublicense, and/or sell copies of the Software, and to permit
3841
- // persons to whom the Software is furnished to do so, subject to the
3842
- // following conditions:
3843
- //
3844
- // The above copyright notice and this permission notice shall be included
3845
- // in all copies or substantial portions of the Software.
3846
- //
3847
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
3848
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3849
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
3850
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
3851
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
3852
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
3853
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
3854
-
3855
- // a transform stream is a readable/writable stream where you do
3856
- // something with the data. Sometimes it's called a "filter",
3857
- // but that's not a great name for it, since that implies a thing where
3858
- // some bits pass through, and others are simply ignored. (That would
3859
- // be a valid example of a transform, of course.)
3860
- //
3861
- // While the output is causally related to the input, it's not a
3862
- // necessarily symmetric or synchronous transformation. For example,
3863
- // a zlib stream might take multiple plain-text writes(), and then
3864
- // emit a single compressed chunk some time in the future.
3865
- //
3866
- // Here's how this works:
3867
- //
3868
- // The Transform stream has all the aspects of the readable and writable
3869
- // stream classes. When you write(chunk), that calls _write(chunk,cb)
3870
- // internally, and returns false if there's a lot of pending writes
3871
- // buffered up. When you call read(), that calls _read(n) until
3872
- // there's enough pending readable data buffered up.
3873
- //
3874
- // In a transform stream, the written data is placed in a buffer. When
3875
- // _read(n) is called, it transforms the queued up data, calling the
3876
- // buffered _write cb's as it consumes chunks. If consuming a single
3877
- // written chunk would result in multiple output chunks, then the first
3878
- // outputted bit calls the readcb, and subsequent chunks just go into
3879
- // the read buffer, and will cause it to emit 'readable' if necessary.
3880
- //
3881
- // This way, back-pressure is actually determined by the reading side,
3882
- // since _read has to be called to start processing a new chunk. However,
3883
- // a pathological inflate type of transform can cause excessive buffering
3884
- // here. For example, imagine a stream where every byte of input is
3885
- // interpreted as an integer from 0-255, and then results in that many
3886
- // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
3887
- // 1kb of data being output. In this case, you could write a very small
3888
- // amount of input, and end up with a very large amount of output. In
3889
- // such a pathological inflating mechanism, there'd be no way to tell
3890
- // the system to stop doing the transform. A single 4MB write could
3891
- // cause the system to run out of memory.
3892
- //
3893
- // However, even in such a pathological case, only a single written chunk
3894
- // would be consumed, and then the rest would wait (un-transformed) until
3895
- // the results of the previous transformed chunk were consumed.
3896
-
3897
- module.exports = Transform;
3898
-
3899
- var Duplex = require('./duplex.js');
3900
- var inherits = require('inherits');
3901
- inherits(Transform, Duplex);
3902
-
3903
-
3904
- function TransformState(options, stream) {
3905
- this.afterTransform = function(er, data) {
3906
- return afterTransform(stream, er, data);
3907
- };
3908
-
3909
- this.needTransform = false;
3910
- this.transforming = false;
3911
- this.writecb = null;
3912
- this.writechunk = null;
3913
- }
3914
-
3915
- function afterTransform(stream, er, data) {
3916
- var ts = stream._transformState;
3917
- ts.transforming = false;
3918
-
3919
- var cb = ts.writecb;
3920
-
3921
- if (!cb)
3922
- return stream.emit('error', new Error('no writecb in Transform class'));
3923
-
3924
- ts.writechunk = null;
3925
- ts.writecb = null;
3926
-
3927
- if (data !== null && data !== undefined)
3928
- stream.push(data);
3929
-
3930
- if (cb)
3931
- cb(er);
3932
-
3933
- var rs = stream._readableState;
3934
- rs.reading = false;
3935
- if (rs.needReadable || rs.length < rs.highWaterMark) {
3936
- stream._read(rs.highWaterMark);
3937
- }
3938
- }
3939
-
3940
-
3941
- function Transform(options) {
3942
- if (!(this instanceof Transform))
3943
- return new Transform(options);
3944
-
3945
- Duplex.call(this, options);
3946
-
3947
- var ts = this._transformState = new TransformState(options, this);
3948
-
3949
- // when the writable side finishes, then flush out anything remaining.
3950
- var stream = this;
3951
-
3952
- // start out asking for a readable event once data is transformed.
3953
- this._readableState.needReadable = true;
3954
-
3955
- // we have implemented the _read method, and done the other things
3956
- // that Readable wants before the first _read call, so unset the
3957
- // sync guard flag.
3958
- this._readableState.sync = false;
3959
-
3960
- this.once('finish', function() {
3961
- if ('function' === typeof this._flush)
3962
- this._flush(function(er) {
3963
- done(stream, er);
3964
- });
3965
- else
3966
- done(stream);
3967
- });
3968
- }
3969
-
3970
- Transform.prototype.push = function(chunk, encoding) {
3971
- this._transformState.needTransform = false;
3972
- return Duplex.prototype.push.call(this, chunk, encoding);
3973
- };
3974
-
3975
- // This is the part where you do stuff!
3976
- // override this function in implementation classes.
3977
- // 'chunk' is an input chunk.
3978
- //
3979
- // Call `push(newChunk)` to pass along transformed output
3980
- // to the readable side. You may call 'push' zero or more times.
3981
- //
3982
- // Call `cb(err)` when you are done with this chunk. If you pass
3983
- // an error, then that'll put the hurt on the whole operation. If you
3984
- // never call cb(), then you'll never get another chunk.
3985
- Transform.prototype._transform = function(chunk, encoding, cb) {
3986
- throw new Error('not implemented');
3987
- };
3988
-
3989
- Transform.prototype._write = function(chunk, encoding, cb) {
3990
- var ts = this._transformState;
3991
- ts.writecb = cb;
3992
- ts.writechunk = chunk;
3993
- ts.writeencoding = encoding;
3994
- if (!ts.transforming) {
3995
- var rs = this._readableState;
3996
- if (ts.needTransform ||
3997
- rs.needReadable ||
3998
- rs.length < rs.highWaterMark)
3999
- this._read(rs.highWaterMark);
4000
- }
4001
- };
4002
-
4003
- // Doesn't matter what the args are here.
4004
- // _transform does all the work.
4005
- // That we got here means that the readable side wants more data.
4006
- Transform.prototype._read = function(n) {
4007
- var ts = this._transformState;
4008
-
4009
- if (ts.writechunk && ts.writecb && !ts.transforming) {
4010
- ts.transforming = true;
4011
- this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
4012
- } else {
4013
- // mark that we need a transform, so that any data that comes in
4014
- // will get processed, now that we've asked for it.
4015
- ts.needTransform = true;
4016
- }
4017
- };
4018
-
4019
-
4020
- function done(stream, er) {
4021
- if (er)
4022
- return stream.emit('error', er);
4023
-
4024
- // if there's nothing in the write buffer, then that means
4025
- // that nothing more will ever be provided
4026
- var ws = stream._writableState;
4027
- var rs = stream._readableState;
4028
- var ts = stream._transformState;
4029
-
4030
- if (ws.length)
4031
- throw new Error('calling transform done when ws.length != 0');
4032
-
4033
- if (ts.transforming)
4034
- throw new Error('calling transform done when still transforming');
4035
-
4036
- return stream.push(null);
4037
- }
4038
-
4039
- },{"./duplex.js":10,"inherits":19}],16:[function(require,module,exports){
4040
- // Copyright Joyent, Inc. and other Node contributors.
4041
- //
4042
- // Permission is hereby granted, free of charge, to any person obtaining a
4043
- // copy of this software and associated documentation files (the
4044
- // "Software"), to deal in the Software without restriction, including
4045
- // without limitation the rights to use, copy, modify, merge, publish,
4046
- // distribute, sublicense, and/or sell copies of the Software, and to permit
4047
- // persons to whom the Software is furnished to do so, subject to the
4048
- // following conditions:
4049
- //
4050
- // The above copyright notice and this permission notice shall be included
4051
- // in all copies or substantial portions of the Software.
4052
- //
4053
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
4054
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
4055
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
4056
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
4057
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
4058
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
4059
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
4060
-
4061
- // A bit simpler than readable streams.
4062
- // Implement an async ._write(chunk, cb), and it'll handle all
4063
- // the drain event emission and buffering.
4064
-
4065
- module.exports = Writable;
4066
- Writable.WritableState = WritableState;
4067
-
4068
- var isUint8Array = typeof Uint8Array !== 'undefined'
4069
- ? function (x) { return x instanceof Uint8Array }
4070
- : function (x) {
4071
- return x && x.constructor && x.constructor.name === 'Uint8Array'
4072
- }
4073
- ;
4074
- var isArrayBuffer = typeof ArrayBuffer !== 'undefined'
4075
- ? function (x) { return x instanceof ArrayBuffer }
4076
- : function (x) {
4077
- return x && x.constructor && x.constructor.name === 'ArrayBuffer'
4078
- }
4079
- ;
4080
-
4081
- var inherits = require('inherits');
4082
- var Stream = require('./index.js');
4083
- var setImmediate = require('process/browser.js').nextTick;
4084
- var Buffer = require('buffer').Buffer;
4085
-
4086
- inherits(Writable, Stream);
4087
-
4088
- function WriteReq(chunk, encoding, cb) {
4089
- this.chunk = chunk;
4090
- this.encoding = encoding;
4091
- this.callback = cb;
4092
- }
4093
-
4094
- function WritableState(options, stream) {
4095
- options = options || {};
4096
-
4097
- // the point at which write() starts returning false
4098
- // Note: 0 is a valid value, means that we always return false if
4099
- // the entire buffer is not flushed immediately on write()
4100
- var hwm = options.highWaterMark;
4101
- this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024;
4102
-
4103
- // object stream flag to indicate whether or not this stream
4104
- // contains buffers or objects.
4105
- this.objectMode = !!options.objectMode;
4106
-
4107
- // cast to ints.
4108
- this.highWaterMark = ~~this.highWaterMark;
4109
-
4110
- this.needDrain = false;
4111
- // at the start of calling end()
4112
- this.ending = false;
4113
- // when end() has been called, and returned
4114
- this.ended = false;
4115
- // when 'finish' is emitted
4116
- this.finished = false;
4117
-
4118
- // should we decode strings into buffers before passing to _write?
4119
- // this is here so that some node-core streams can optimize string
4120
- // handling at a lower level.
4121
- var noDecode = options.decodeStrings === false;
4122
- this.decodeStrings = !noDecode;
4123
-
4124
- // Crypto is kind of old and crusty. Historically, its default string
4125
- // encoding is 'binary' so we have to make this configurable.
4126
- // Everything else in the universe uses 'utf8', though.
4127
- this.defaultEncoding = options.defaultEncoding || 'utf8';
4128
-
4129
- // not an actual buffer we keep track of, but a measurement
4130
- // of how much we're waiting to get pushed to some underlying
4131
- // socket or file.
4132
- this.length = 0;
4133
-
4134
- // a flag to see when we're in the middle of a write.
4135
- this.writing = false;
4136
-
4137
- // a flag to be able to tell if the onwrite cb is called immediately,
4138
- // or on a later tick. We set this to true at first, becuase any
4139
- // actions that shouldn't happen until "later" should generally also
4140
- // not happen before the first write call.
4141
- this.sync = true;
4142
-
4143
- // a flag to know if we're processing previously buffered items, which
4144
- // may call the _write() callback in the same tick, so that we don't
4145
- // end up in an overlapped onwrite situation.
4146
- this.bufferProcessing = false;
4147
-
4148
- // the callback that's passed to _write(chunk,cb)
4149
- this.onwrite = function(er) {
4150
- onwrite(stream, er);
4151
- };
4152
-
4153
- // the callback that the user supplies to write(chunk,encoding,cb)
4154
- this.writecb = null;
4155
-
4156
- // the amount that is being written when _write is called.
4157
- this.writelen = 0;
4158
-
4159
- this.buffer = [];
4160
- }
4161
-
4162
- function Writable(options) {
4163
- // Writable ctor is applied to Duplexes, though they're not
4164
- // instanceof Writable, they're instanceof Readable.
4165
- if (!(this instanceof Writable) && !(this instanceof Stream.Duplex))
4166
- return new Writable(options);
4167
-
4168
- this._writableState = new WritableState(options, this);
4169
-
4170
- // legacy.
4171
- this.writable = true;
4172
-
4173
- Stream.call(this);
4174
- }
4175
-
4176
- // Otherwise people can pipe Writable streams, which is just wrong.
4177
- Writable.prototype.pipe = function() {
4178
- this.emit('error', new Error('Cannot pipe. Not readable.'));
4179
- };
4180
-
4181
-
4182
- function writeAfterEnd(stream, state, cb) {
4183
- var er = new Error('write after end');
4184
- // TODO: defer error events consistently everywhere, not just the cb
4185
- stream.emit('error', er);
4186
- setImmediate(function() {
4187
- cb(er);
4188
- });
4189
- }
4190
-
4191
- // If we get something that is not a buffer, string, null, or undefined,
4192
- // and we're not in objectMode, then that's an error.
4193
- // Otherwise stream chunks are all considered to be of length=1, and the
4194
- // watermarks determine how many objects to keep in the buffer, rather than
4195
- // how many bytes or characters.
4196
- function validChunk(stream, state, chunk, cb) {
4197
- var valid = true;
4198
- if (!Buffer.isBuffer(chunk) &&
4199
- 'string' !== typeof chunk &&
4200
- chunk !== null &&
4201
- chunk !== undefined &&
4202
- !state.objectMode) {
4203
- var er = new TypeError('Invalid non-string/buffer chunk');
4204
- stream.emit('error', er);
4205
- setImmediate(function() {
4206
- cb(er);
4207
- });
4208
- valid = false;
4209
- }
4210
- return valid;
4211
- }
4212
-
4213
- Writable.prototype.write = function(chunk, encoding, cb) {
4214
- var state = this._writableState;
4215
- var ret = false;
4216
-
4217
- if (typeof encoding === 'function') {
4218
- cb = encoding;
4219
- encoding = null;
4220
- }
4221
-
4222
- if (!Buffer.isBuffer(chunk) && isUint8Array(chunk))
4223
- chunk = new Buffer(chunk);
4224
- if (isArrayBuffer(chunk) && typeof Uint8Array !== 'undefined')
4225
- chunk = new Buffer(new Uint8Array(chunk));
4226
-
4227
- if (Buffer.isBuffer(chunk))
4228
- encoding = 'buffer';
4229
- else if (!encoding)
4230
- encoding = state.defaultEncoding;
4231
-
4232
- if (typeof cb !== 'function')
4233
- cb = function() {};
4234
-
4235
- if (state.ended)
4236
- writeAfterEnd(this, state, cb);
4237
- else if (validChunk(this, state, chunk, cb))
4238
- ret = writeOrBuffer(this, state, chunk, encoding, cb);
4239
-
4240
- return ret;
4241
- };
4242
-
4243
- function decodeChunk(state, chunk, encoding) {
4244
- if (!state.objectMode &&
4245
- state.decodeStrings !== false &&
4246
- typeof chunk === 'string') {
4247
- chunk = new Buffer(chunk, encoding);
4248
- }
4249
- return chunk;
4250
- }
4251
-
4252
- // if we're already writing something, then just put this
4253
- // in the queue, and wait our turn. Otherwise, call _write
4254
- // If we return false, then we need a drain event, so set that flag.
4255
- function writeOrBuffer(stream, state, chunk, encoding, cb) {
4256
- chunk = decodeChunk(state, chunk, encoding);
4257
- var len = state.objectMode ? 1 : chunk.length;
4258
-
4259
- state.length += len;
4260
-
4261
- var ret = state.length < state.highWaterMark;
4262
- state.needDrain = !ret;
4263
-
4264
- if (state.writing)
4265
- state.buffer.push(new WriteReq(chunk, encoding, cb));
4266
- else
4267
- doWrite(stream, state, len, chunk, encoding, cb);
4268
-
4269
- return ret;
4270
- }
4271
-
4272
- function doWrite(stream, state, len, chunk, encoding, cb) {
4273
- state.writelen = len;
4274
- state.writecb = cb;
4275
- state.writing = true;
4276
- state.sync = true;
4277
- stream._write(chunk, encoding, state.onwrite);
4278
- state.sync = false;
4279
- }
4280
-
4281
- function onwriteError(stream, state, sync, er, cb) {
4282
- if (sync)
4283
- setImmediate(function() {
4284
- cb(er);
4285
- });
4286
- else
4287
- cb(er);
4288
-
4289
- stream.emit('error', er);
4290
- }
4291
-
4292
- function onwriteStateUpdate(state) {
4293
- state.writing = false;
4294
- state.writecb = null;
4295
- state.length -= state.writelen;
4296
- state.writelen = 0;
4297
- }
4298
-
4299
- function onwrite(stream, er) {
4300
- var state = stream._writableState;
4301
- var sync = state.sync;
4302
- var cb = state.writecb;
4303
-
4304
- onwriteStateUpdate(state);
4305
-
4306
- if (er)
4307
- onwriteError(stream, state, sync, er, cb);
4308
- else {
4309
- // Check if we're actually ready to finish, but don't emit yet
4310
- var finished = needFinish(stream, state);
4311
-
4312
- if (!finished && !state.bufferProcessing && state.buffer.length)
4313
- clearBuffer(stream, state);
4314
-
4315
- if (sync) {
4316
- setImmediate(function() {
4317
- afterWrite(stream, state, finished, cb);
4318
- });
4319
- } else {
4320
- afterWrite(stream, state, finished, cb);
4321
- }
4322
- }
4323
- }
4324
-
4325
- function afterWrite(stream, state, finished, cb) {
4326
- if (!finished)
4327
- onwriteDrain(stream, state);
4328
- cb();
4329
- if (finished)
4330
- finishMaybe(stream, state);
4331
- }
4332
-
4333
- // Must force callback to be called on nextTick, so that we don't
4334
- // emit 'drain' before the write() consumer gets the 'false' return
4335
- // value, and has a chance to attach a 'drain' listener.
4336
- function onwriteDrain(stream, state) {
4337
- if (state.length === 0 && state.needDrain) {
4338
- state.needDrain = false;
4339
- stream.emit('drain');
4340
- }
4341
- }
4342
-
4343
-
4344
- // if there's something in the buffer waiting, then process it
4345
- function clearBuffer(stream, state) {
4346
- state.bufferProcessing = true;
4347
-
4348
- for (var c = 0; c < state.buffer.length; c++) {
4349
- var entry = state.buffer[c];
4350
- var chunk = entry.chunk;
4351
- var encoding = entry.encoding;
4352
- var cb = entry.callback;
4353
- var len = state.objectMode ? 1 : chunk.length;
4354
-
4355
- doWrite(stream, state, len, chunk, encoding, cb);
4356
-
4357
- // if we didn't call the onwrite immediately, then
4358
- // it means that we need to wait until it does.
4359
- // also, that means that the chunk and cb are currently
4360
- // being processed, so move the buffer counter past them.
4361
- if (state.writing) {
4362
- c++;
4363
- break;
4364
- }
4365
- }
4366
-
4367
- state.bufferProcessing = false;
4368
- if (c < state.buffer.length)
4369
- state.buffer = state.buffer.slice(c);
4370
- else
4371
- state.buffer.length = 0;
4372
- }
4373
-
4374
- Writable.prototype._write = function(chunk, encoding, cb) {
4375
- cb(new Error('not implemented'));
4376
- };
4377
-
4378
- Writable.prototype.end = function(chunk, encoding, cb) {
4379
- var state = this._writableState;
4380
-
4381
- if (typeof chunk === 'function') {
4382
- cb = chunk;
4383
- chunk = null;
4384
- encoding = null;
4385
- } else if (typeof encoding === 'function') {
4386
- cb = encoding;
4387
- encoding = null;
4388
- }
4389
-
4390
- if (typeof chunk !== 'undefined' && chunk !== null)
4391
- this.write(chunk, encoding);
4392
-
4393
- // ignore unnecessary end() calls.
4394
- if (!state.ending && !state.finished)
4395
- endWritable(this, state, cb);
4396
- };
4397
-
4398
-
4399
- function needFinish(stream, state) {
4400
- return (state.ending &&
4401
- state.length === 0 &&
4402
- !state.finished &&
4403
- !state.writing);
4404
- }
4405
-
4406
- function finishMaybe(stream, state) {
4407
- var need = needFinish(stream, state);
4408
- if (need) {
4409
- state.finished = true;
4410
- stream.emit('finish');
4411
- }
4412
- return need;
4413
- }
4414
-
4415
- function endWritable(stream, state, cb) {
4416
- state.ending = true;
4417
- finishMaybe(stream, state);
4418
- if (cb) {
4419
- if (state.finished)
4420
- setImmediate(cb);
4421
- else
4422
- stream.once('finish', cb);
4423
- }
4424
- state.ended = true;
4425
- }
4426
-
4427
- },{"./index.js":11,"buffer":7,"inherits":19,"process/browser.js":12}],17:[function(require,module,exports){
4428
- // Copyright Joyent, Inc. and other Node contributors.
4429
- //
4430
- // Permission is hereby granted, free of charge, to any person obtaining a
4431
- // copy of this software and associated documentation files (the
4432
- // "Software"), to deal in the Software without restriction, including
4433
- // without limitation the rights to use, copy, modify, merge, publish,
4434
- // distribute, sublicense, and/or sell copies of the Software, and to permit
4435
- // persons to whom the Software is furnished to do so, subject to the
4436
- // following conditions:
4437
- //
4438
- // The above copyright notice and this permission notice shall be included
4439
- // in all copies or substantial portions of the Software.
4440
- //
4441
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
4442
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
4443
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
4444
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
4445
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
4446
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
4447
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
4448
-
4449
- var Buffer = require('buffer').Buffer;
4450
-
4451
- function assertEncoding(encoding) {
4452
- if (encoding && !Buffer.isEncoding(encoding)) {
4453
- throw new Error('Unknown encoding: ' + encoding);
4454
- }
4455
- }
4456
-
4457
- var StringDecoder = exports.StringDecoder = function(encoding) {
4458
- this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
4459
- assertEncoding(encoding);
4460
- switch (this.encoding) {
4461
- case 'utf8':
4462
- // CESU-8 represents each of Surrogate Pair by 3-bytes
4463
- this.surrogateSize = 3;
4464
- break;
4465
- case 'ucs2':
4466
- case 'utf16le':
4467
- // UTF-16 represents each of Surrogate Pair by 2-bytes
4468
- this.surrogateSize = 2;
4469
- this.detectIncompleteChar = utf16DetectIncompleteChar;
4470
- break;
4471
- case 'base64':
4472
- // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
4473
- this.surrogateSize = 3;
4474
- this.detectIncompleteChar = base64DetectIncompleteChar;
4475
- break;
4476
- default:
4477
- this.write = passThroughWrite;
4478
- return;
4479
- }
4480
-
4481
- this.charBuffer = new Buffer(6);
4482
- this.charReceived = 0;
4483
- this.charLength = 0;
4484
- };
4485
-
4486
-
4487
- StringDecoder.prototype.write = function(buffer) {
4488
- var charStr = '';
4489
- var offset = 0;
4490
-
4491
- // if our last write ended with an incomplete multibyte character
4492
- while (this.charLength) {
4493
- // determine how many remaining bytes this buffer has to offer for this char
4494
- var i = (buffer.length >= this.charLength - this.charReceived) ?
4495
- this.charLength - this.charReceived :
4496
- buffer.length;
4497
-
4498
- // add the new bytes to the char buffer
4499
- buffer.copy(this.charBuffer, this.charReceived, offset, i);
4500
- this.charReceived += (i - offset);
4501
- offset = i;
4502
-
4503
- if (this.charReceived < this.charLength) {
4504
- // still not enough chars in this buffer? wait for more ...
4505
- return '';
4506
- }
4507
-
4508
- // get the character that was split
4509
- charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
4510
-
4511
- // lead surrogate (D800-DBFF) is also the incomplete character
4512
- var charCode = charStr.charCodeAt(charStr.length - 1);
4513
- if (charCode >= 0xD800 && charCode <= 0xDBFF) {
4514
- this.charLength += this.surrogateSize;
4515
- charStr = '';
4516
- continue;
4517
- }
4518
- this.charReceived = this.charLength = 0;
4519
-
4520
- // if there are no more bytes in this buffer, just emit our char
4521
- if (i == buffer.length) return charStr;
4522
-
4523
- // otherwise cut off the characters end from the beginning of this buffer
4524
- buffer = buffer.slice(i, buffer.length);
4525
- break;
4526
- }
4527
-
4528
- var lenIncomplete = this.detectIncompleteChar(buffer);
4529
-
4530
- var end = buffer.length;
4531
- if (this.charLength) {
4532
- // buffer the incomplete character bytes we got
4533
- buffer.copy(this.charBuffer, 0, buffer.length - lenIncomplete, end);
4534
- this.charReceived = lenIncomplete;
4535
- end -= lenIncomplete;
4536
- }
4537
-
4538
- charStr += buffer.toString(this.encoding, 0, end);
4539
-
4540
- var end = charStr.length - 1;
4541
- var charCode = charStr.charCodeAt(end);
4542
- // lead surrogate (D800-DBFF) is also the incomplete character
4543
- if (charCode >= 0xD800 && charCode <= 0xDBFF) {
4544
- var size = this.surrogateSize;
4545
- this.charLength += size;
4546
- this.charReceived += size;
4547
- this.charBuffer.copy(this.charBuffer, size, 0, size);
4548
- this.charBuffer.write(charStr.charAt(charStr.length - 1), this.encoding);
4549
- return charStr.substring(0, end);
4550
- }
4551
-
4552
- // or just emit the charStr
4553
- return charStr;
4554
- };
4555
-
4556
- StringDecoder.prototype.detectIncompleteChar = function(buffer) {
4557
- // determine how many bytes we have to check at the end of this buffer
4558
- var i = (buffer.length >= 3) ? 3 : buffer.length;
4559
-
4560
- // Figure out if one of the last i bytes of our buffer announces an
4561
- // incomplete char.
4562
- for (; i > 0; i--) {
4563
- var c = buffer[buffer.length - i];
4564
-
4565
- // See http://en.wikipedia.org/wiki/UTF-8#Description
4566
-
4567
- // 110XXXXX
4568
- if (i == 1 && c >> 5 == 0x06) {
4569
- this.charLength = 2;
4570
- break;
4571
- }
4572
-
4573
- // 1110XXXX
4574
- if (i <= 2 && c >> 4 == 0x0E) {
4575
- this.charLength = 3;
4576
- break;
4577
- }
4578
-
4579
- // 11110XXX
4580
- if (i <= 3 && c >> 3 == 0x1E) {
4581
- this.charLength = 4;
4582
- break;
4583
- }
4584
- }
4585
-
4586
- return i;
4587
- };
4588
-
4589
- StringDecoder.prototype.end = function(buffer) {
4590
- var res = '';
4591
- if (buffer && buffer.length)
4592
- res = this.write(buffer);
4593
-
4594
- if (this.charReceived) {
4595
- var cr = this.charReceived;
4596
- var buf = this.charBuffer;
4597
- var enc = this.encoding;
4598
- res += buf.slice(0, cr).toString(enc);
4599
- }
4600
-
4601
- return res;
4602
- };
4603
-
4604
- function passThroughWrite(buffer) {
4605
- return buffer.toString(this.encoding);
4606
- }
4607
-
4608
- function utf16DetectIncompleteChar(buffer) {
4609
- var incomplete = this.charReceived = buffer.length % 2;
4610
- this.charLength = incomplete ? 2 : 0;
4611
- return incomplete;
4612
- }
4613
-
4614
- function base64DetectIncompleteChar(buffer) {
4615
- var incomplete = this.charReceived = buffer.length % 3;
4616
- this.charLength = incomplete ? 3 : 0;
4617
- return incomplete;
4618
- }
4619
-
4620
- },{"buffer":7}],18:[function(require,module,exports){
4621
- exports.read = function (buffer, offset, isLE, mLen, nBytes) {
4622
- var e, m
4623
- var eLen = (nBytes * 8) - mLen - 1
4624
- var eMax = (1 << eLen) - 1
4625
- var eBias = eMax >> 1
4626
- var nBits = -7
4627
- var i = isLE ? (nBytes - 1) : 0
4628
- var d = isLE ? -1 : 1
4629
- var s = buffer[offset + i]
4630
-
4631
- i += d
4632
-
4633
- e = s & ((1 << (-nBits)) - 1)
4634
- s >>= (-nBits)
4635
- nBits += eLen
4636
- for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
4637
-
4638
- m = e & ((1 << (-nBits)) - 1)
4639
- e >>= (-nBits)
4640
- nBits += mLen
4641
- for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
4642
-
4643
- if (e === 0) {
4644
- e = 1 - eBias
4645
- } else if (e === eMax) {
4646
- return m ? NaN : ((s ? -1 : 1) * Infinity)
4647
- } else {
4648
- m = m + Math.pow(2, mLen)
4649
- e = e - eBias
4650
- }
4651
- return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
4652
- }
4653
-
4654
- exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
4655
- var e, m, c
4656
- var eLen = (nBytes * 8) - mLen - 1
4657
- var eMax = (1 << eLen) - 1
4658
- var eBias = eMax >> 1
4659
- var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
4660
- var i = isLE ? 0 : (nBytes - 1)
4661
- var d = isLE ? 1 : -1
4662
- var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
4663
-
4664
- value = Math.abs(value)
4665
-
4666
- if (isNaN(value) || value === Infinity) {
4667
- m = isNaN(value) ? 1 : 0
4668
- e = eMax
4669
- } else {
4670
- e = Math.floor(Math.log(value) / Math.LN2)
4671
- if (value * (c = Math.pow(2, -e)) < 1) {
4672
- e--
4673
- c *= 2
4674
- }
4675
- if (e + eBias >= 1) {
4676
- value += rt / c
4677
- } else {
4678
- value += rt * Math.pow(2, 1 - eBias)
4679
- }
4680
- if (value * c >= 2) {
4681
- e++
4682
- c /= 2
4683
- }
4684
-
4685
- if (e + eBias >= eMax) {
4686
- m = 0
4687
- e = eMax
4688
- } else if (e + eBias >= 1) {
4689
- m = ((value * c) - 1) * Math.pow(2, mLen)
4690
- e = e + eBias
4691
- } else {
4692
- m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
4693
- e = 0
4694
- }
4695
- }
4696
-
4697
- for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
4698
-
4699
- e = (e << mLen) | m
4700
- eLen += mLen
4701
- for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
4702
-
4703
- buffer[offset + i - d] |= s * 128
4704
- }
4705
-
4706
- },{}],19:[function(require,module,exports){
4707
- module.exports=require(3)
4708
- },{}],20:[function(require,module,exports){
4709
- 'use strict';
4710
-
4711
- var assert = require('assert');
4712
- var stream = require('stream');
4713
- var hash = require('../index');
4714
-
4715
- describe('writeToStream', function() {
4716
- it('should emit information about an object to a stream', function() {
4717
- var strm = new stream.PassThrough();
4718
-
4719
- hash.writeToStream({foo: 'bar'}, strm);
4720
- var result = strm.read().toString();
4721
- assert.strictEqual(typeof result, 'string');
4722
- assert.notStrictEqual(result.indexOf('foo'), -1);
4723
- assert.notStrictEqual(result.indexOf('bar'), -1);
4724
- });
4725
-
4726
- it('should leave out keys when excludeValues = true', function() {
4727
- var strm = new stream.PassThrough();
4728
-
4729
- hash.writeToStream({foo: 'bar'}, {excludeValues: true}, strm);
4730
- var result = strm.read().toString();
4731
- assert.strictEqual(typeof result, 'string');
4732
- assert.notStrictEqual(result.indexOf('foo'), -1);
4733
- assert. strictEqual(result.indexOf('bar'), -1);
4734
- });
4735
- });
4736
-
4737
- },{"../index":1,"assert":2,"stream":11}]},{},[20])