@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.
- package/lib/index.js +56 -0
- package/package.json +20 -201
- package/LICENSE +0 -12
- package/README.md +0 -111
- package/agent-loader.js +0 -44
- package/bin/VERSION +0 -1
- package/bin/contrast-service-darwin-arm64 +0 -0
- package/bin/contrast-service-darwin-x64 +0 -0
- package/bin/contrast-service-linux-arm64 +0 -0
- package/bin/contrast-service-linux-x64 +0 -0
- package/bin/contrast-service-win32-x64.exe +0 -0
- package/bootstrap.js +0 -65
- package/changelog.config.js +0 -56
- package/cli-rewriter.js +0 -24
- package/cli.js +0 -38
- package/config-diagnostics.js +0 -127
- package/esm.mjs +0 -156
- package/lib/agent-emitter.js +0 -89
- package/lib/agent.js +0 -214
- package/lib/app-info.js +0 -150
- package/lib/assess/deadzones/index.js +0 -93
- package/lib/assess/deadzones/rewrite.js +0 -64
- package/lib/assess/express/index.js +0 -29
- package/lib/assess/express/route-coverage.js +0 -143
- package/lib/assess/express/sinks/index.js +0 -23
- package/lib/assess/express/sinks/xss.js +0 -88
- package/lib/assess/express/sources.js +0 -56
- package/lib/assess/fastify/index.js +0 -29
- package/lib/assess/fastify/route-coverage.js +0 -119
- package/lib/assess/fastify/sinks/index.js +0 -25
- package/lib/assess/fastify/sinks/response-scanning.js +0 -54
- package/lib/assess/fastify/sinks/unvalidated-redirect.js +0 -95
- package/lib/assess/fastify/sinks/xss.js +0 -238
- package/lib/assess/fastify/sources.js +0 -76
- package/lib/assess/hapi/index.js +0 -29
- package/lib/assess/hapi/route-coverage.js +0 -163
- package/lib/assess/hapi/sinks/index.js +0 -27
- package/lib/assess/hapi/sinks/response-scanning.js +0 -49
- package/lib/assess/hapi/sinks/session.js +0 -125
- package/lib/assess/hapi/sinks/unvalidated-redirect.js +0 -100
- package/lib/assess/hapi/sinks/xss.js +0 -178
- package/lib/assess/hapi/sources.js +0 -37
- package/lib/assess/index.js +0 -35
- package/lib/assess/koa/index.js +0 -29
- package/lib/assess/koa/route-coverage.js +0 -114
- package/lib/assess/koa/sinks/index.js +0 -25
- package/lib/assess/koa/sinks/response-scanning.js +0 -40
- package/lib/assess/koa/sinks/unvalidated-redirect.js +0 -96
- package/lib/assess/koa/sinks/xss.js +0 -127
- package/lib/assess/koa/sources.js +0 -145
- package/lib/assess/loopback4/index.js +0 -29
- package/lib/assess/loopback4/route-coverage.js +0 -129
- package/lib/assess/loopback4/sinks/index.js +0 -25
- package/lib/assess/loopback4/sinks/response-scanning.js +0 -39
- package/lib/assess/loopback4/sinks/xss.js +0 -77
- package/lib/assess/loopback4/sources.js +0 -33
- package/lib/assess/membrane/debraner.js +0 -170
- package/lib/assess/membrane/deserialization-membrane.js +0 -76
- package/lib/assess/membrane/index.js +0 -463
- package/lib/assess/membrane/source-membrane.js +0 -415
- package/lib/assess/models/base-event.js +0 -207
- package/lib/assess/models/call-context.js +0 -197
- package/lib/assess/models/index.js +0 -31
- package/lib/assess/models/propagation-event.js +0 -77
- package/lib/assess/models/signature.js +0 -92
- package/lib/assess/models/sink-event.js +0 -43
- package/lib/assess/models/source-event.js +0 -95
- package/lib/assess/models/tag-range/index.js +0 -180
- package/lib/assess/models/tag-range/relationships.js +0 -67
- package/lib/assess/models/tag-range/util.js +0 -363
- package/lib/assess/policy/deadzones.json +0 -185
- package/lib/assess/policy/index.js +0 -20
- package/lib/assess/policy/init.js +0 -309
- package/lib/assess/policy/non-dataflow-rules.json +0 -156
- package/lib/assess/policy/propagators.json +0 -545
- package/lib/assess/policy/rules.json +0 -1682
- package/lib/assess/policy/signatures.json +0 -1412
- package/lib/assess/policy/util.js +0 -423
- package/lib/assess/propagators/JSON/parse.js +0 -53
- package/lib/assess/propagators/JSON/stringify.js +0 -444
- package/lib/assess/propagators/ajv/conditionals.js +0 -164
- package/lib/assess/propagators/ajv/evaluator-shim.js +0 -42
- package/lib/assess/propagators/ajv/index.js +0 -91
- package/lib/assess/propagators/ajv/json-schema-type-evaluators.js +0 -495
- package/lib/assess/propagators/ajv/object-walk.js +0 -76
- package/lib/assess/propagators/ajv/refs.js +0 -265
- package/lib/assess/propagators/ajv/schema-context.js +0 -388
- package/lib/assess/propagators/array-prototype-join.js +0 -163
- package/lib/assess/propagators/common.js +0 -137
- package/lib/assess/propagators/dustjs/escape-html.js +0 -22
- package/lib/assess/propagators/dustjs/escape-js.js +0 -22
- package/lib/assess/propagators/ejs-template-generate-source.js +0 -64
- package/lib/assess/propagators/encode-uri/encode-uri-component.js +0 -22
- package/lib/assess/propagators/encode-uri/encode-uri.js +0 -22
- package/lib/assess/propagators/fastify-static/allowed-path.js +0 -85
- package/lib/assess/propagators/handlebars-compile.js +0 -78
- package/lib/assess/propagators/handlebars-escape-expresssion.js +0 -71
- package/lib/assess/propagators/index.js +0 -154
- package/lib/assess/propagators/joi/any.js +0 -47
- package/lib/assess/propagators/joi/boolean.js +0 -68
- package/lib/assess/propagators/joi/expression.js +0 -48
- package/lib/assess/propagators/joi/index.js +0 -27
- package/lib/assess/propagators/joi/keys.js +0 -72
- package/lib/assess/propagators/joi/number.js +0 -67
- package/lib/assess/propagators/joi/object.js +0 -60
- package/lib/assess/propagators/joi/string-base.js +0 -123
- package/lib/assess/propagators/joi/string-schema.js +0 -199
- package/lib/assess/propagators/joi/values.js +0 -304
- package/lib/assess/propagators/manager.js +0 -469
- package/lib/assess/propagators/mongoose/helpers.js +0 -57
- package/lib/assess/propagators/mongoose/index.js +0 -19
- package/lib/assess/propagators/mongoose/map.js +0 -62
- package/lib/assess/propagators/mongoose/mixed.js +0 -71
- package/lib/assess/propagators/mongoose/string.js +0 -112
- package/lib/assess/propagators/mustache/escape.js +0 -22
- package/lib/assess/propagators/number.js +0 -54
- package/lib/assess/propagators/object.js +0 -60
- package/lib/assess/propagators/path/basename.js +0 -113
- package/lib/assess/propagators/path/common.js +0 -387
- package/lib/assess/propagators/path/dirname.js +0 -78
- package/lib/assess/propagators/path/extname.js +0 -83
- package/lib/assess/propagators/path/format.js +0 -65
- package/lib/assess/propagators/path/join.js +0 -53
- package/lib/assess/propagators/path/normalize.js +0 -55
- package/lib/assess/propagators/path/parse.js +0 -43
- package/lib/assess/propagators/path/relative.js +0 -154
- package/lib/assess/propagators/path/resolve.js +0 -63
- package/lib/assess/propagators/path/to-namespaced-path.js +0 -52
- package/lib/assess/propagators/pug-compile.js +0 -58
- package/lib/assess/propagators/querystring/escape.js +0 -56
- package/lib/assess/propagators/querystring/parse.js +0 -118
- package/lib/assess/propagators/querystring/stringify.js +0 -313
- package/lib/assess/propagators/querystring/unescape.js +0 -60
- package/lib/assess/propagators/querystring/utils.js +0 -69
- package/lib/assess/propagators/sequelize/sql-string-escape.js +0 -61
- package/lib/assess/propagators/sequelize/sql-string-format-named-parameters.js +0 -145
- package/lib/assess/propagators/sequelize/sql-string-format.js +0 -104
- package/lib/assess/propagators/sequelize/utils.js +0 -36
- package/lib/assess/propagators/serve-static.js +0 -109
- package/lib/assess/propagators/string-prototype-replace.js +0 -671
- package/lib/assess/propagators/string-prototype-split.js +0 -266
- package/lib/assess/propagators/string-prototype-trim.js +0 -61
- package/lib/assess/propagators/string.js +0 -68
- package/lib/assess/propagators/template-escape.js +0 -87
- package/lib/assess/propagators/templates.js +0 -168
- package/lib/assess/propagators/url/url-prototype-parse.js +0 -133
- package/lib/assess/propagators/url/url-url.js +0 -464
- package/lib/assess/propagators/url/utils.js +0 -58
- package/lib/assess/propagators/util/format.js +0 -305
- package/lib/assess/propagators/utils.js +0 -148
- package/lib/assess/propagators/v8/init-hooks.js +0 -142
- package/lib/assess/propagators/validator/init-hooks.js +0 -252
- package/lib/assess/propagators/validator/validator-methods.js +0 -98
- package/lib/assess/response-scanning/app-activity.js +0 -33
- package/lib/assess/response-scanning/autocomplete-missing.js +0 -66
- package/lib/assess/response-scanning/cache-controls-missing.js +0 -205
- package/lib/assess/response-scanning/clickjacking-control-missing.js +0 -49
- package/lib/assess/response-scanning/common.js +0 -58
- package/lib/assess/response-scanning/cookies/common.js +0 -63
- package/lib/assess/response-scanning/cookies/events.js +0 -28
- package/lib/assess/response-scanning/cookies/httponly.js +0 -45
- package/lib/assess/response-scanning/cookies/secure-flag-missing.js +0 -46
- package/lib/assess/response-scanning/headers/csp-header-insecure.js +0 -190
- package/lib/assess/response-scanning/headers/csp-header-missing.js +0 -45
- package/lib/assess/response-scanning/headers/csp-utils.js +0 -28
- package/lib/assess/response-scanning/headers/hsts-header-missing.js +0 -59
- package/lib/assess/response-scanning/headers/powered-by.js +0 -53
- package/lib/assess/response-scanning/headers/xcontenttype-header-missing.js +0 -51
- package/lib/assess/response-scanning/headers/xxssprotection-header-disabled.js +0 -46
- package/lib/assess/response-scanning/parameter-pollution.js +0 -63
- package/lib/assess/response-scanning/parseable-response-emitter.js +0 -43
- package/lib/assess/restify/index.js +0 -30
- package/lib/assess/restify/route-coverage.js +0 -86
- package/lib/assess/restify/session.js +0 -53
- package/lib/assess/restify/sinks/index.js +0 -25
- package/lib/assess/restify/sinks/response-scanning.js +0 -48
- package/lib/assess/restify/sinks/unvalidated-redirect.js +0 -100
- package/lib/assess/restify/sinks/xss.js +0 -87
- package/lib/assess/restify/sources.js +0 -224
- package/lib/assess/sinks/common.js +0 -513
- package/lib/assess/sinks/dustjs-linkedin-xss.js +0 -131
- package/lib/assess/sinks/dynamo.js +0 -277
- package/lib/assess/sinks/hapi-16-xss.js +0 -75
- package/lib/assess/sinks/index.js +0 -179
- package/lib/assess/sinks/libxmljs-xxe.js +0 -57
- package/lib/assess/sinks/mongodb.js +0 -368
- package/lib/assess/sinks/rethinkdb-nosql-injection.js +0 -142
- package/lib/assess/sinks/ssrf-url.js +0 -98
- package/lib/assess/sources/event-handler.js +0 -309
- package/lib/assess/sources/formidable.js +0 -38
- package/lib/assess/sources/index.js +0 -247
- package/lib/assess/spdy/index.js +0 -23
- package/lib/assess/spdy/sinks/index.js +0 -23
- package/lib/assess/spdy/sinks/xss.js +0 -84
- package/lib/assess/static/hardcoded.js +0 -345
- package/lib/assess/static/read-findings-from-cache.js +0 -40
- package/lib/assess/technologies/index.js +0 -48
- package/lib/assess/utils.js +0 -22
- package/lib/cat.txt +0 -87
- package/lib/cli-rewriter/index.js +0 -328
- package/lib/constants.js +0 -749
- package/lib/contrast.js +0 -465
- package/lib/core/arch-components/dynamodb.js +0 -45
- package/lib/core/arch-components/dynamodbv3.js +0 -48
- package/lib/core/arch-components/index.js +0 -23
- package/lib/core/arch-components/mongodb.js +0 -189
- package/lib/core/arch-components/mysql.js +0 -63
- package/lib/core/arch-components/postgres.js +0 -70
- package/lib/core/arch-components/rethinkdb.js +0 -53
- package/lib/core/arch-components/sqlite3.js +0 -44
- package/lib/core/arch-components/util.js +0 -51
- package/lib/core/async-storage/context.js +0 -133
- package/lib/core/async-storage/hooks/bluebird.js +0 -91
- package/lib/core/async-storage/hooks/mongodb.js +0 -157
- package/lib/core/async-storage/hooks/mysql.js +0 -154
- package/lib/core/async-storage/hooks/redis.js +0 -38
- package/lib/core/async-storage/hooks/utils.js +0 -42
- package/lib/core/async-storage/index.js +0 -222
- package/lib/core/async-storage/scopes/index.js +0 -153
- package/lib/core/common/formidable.js +0 -65
- package/lib/core/common/index.js +0 -19
- package/lib/core/config/options.js +0 -1015
- package/lib/core/config/util.js +0 -391
- package/lib/core/exclusions/exclusion-factory.js +0 -124
- package/lib/core/exclusions/exclusion.js +0 -48
- package/lib/core/exclusions/input.js +0 -95
- package/lib/core/exclusions/url.js +0 -66
- package/lib/core/express/index.js +0 -538
- package/lib/core/express/utils.js +0 -571
- package/lib/core/fastify/index.js +0 -199
- package/lib/core/fastify/utils.js +0 -28
- package/lib/core/hapi/index.js +0 -215
- package/lib/core/hapi/utils.js +0 -126
- package/lib/core/index.js +0 -34
- package/lib/core/koa/index.js +0 -299
- package/lib/core/koa/utils.js +0 -31
- package/lib/core/logger/daily-rotate-file.js +0 -45
- package/lib/core/logger/dataflow-monitor.js +0 -124
- package/lib/core/logger/debug-logger.js +0 -364
- package/lib/core/logger/index.js +0 -43
- package/lib/core/logger/perf-logger.js +0 -241
- package/lib/core/logger/umbrella-logger.js +0 -163
- package/lib/core/loopback4/index.js +0 -173
- package/lib/core/metrics/index.js +0 -150
- package/lib/core/restify/index.js +0 -147
- package/lib/core/restify/utils.js +0 -84
- package/lib/core/rewrite/assignment-expression.js +0 -40
- package/lib/core/rewrite/binary-expression.js +0 -63
- package/lib/core/rewrite/call-expression.js +0 -44
- package/lib/core/rewrite/callees.js +0 -142
- package/lib/core/rewrite/catch-clause.js +0 -49
- package/lib/core/rewrite/function-wrap.js +0 -49
- package/lib/core/rewrite/import-declaration.js +0 -71
- package/lib/core/rewrite/index.js +0 -316
- package/lib/core/rewrite/injections.js +0 -169
- package/lib/core/rewrite/is-contrast-method.js +0 -28
- package/lib/core/rewrite/log.js +0 -24
- package/lib/core/rewrite/member-expression.js +0 -52
- package/lib/core/rewrite/object-property.js +0 -46
- package/lib/core/rewrite/prepend-globals.js +0 -48
- package/lib/core/rewrite/rewrite-log.js +0 -74
- package/lib/core/rewrite/switch-statement.js +0 -71
- package/lib/core/rewrite/template-literal.js +0 -64
- package/lib/core/stacktrace.js +0 -221
- package/lib/coverage.js +0 -158
- package/lib/feature-set.js +0 -297
- package/lib/generator-function.js +0 -20
- package/lib/hooks/array.js +0 -75
- package/lib/hooks/cluster.js +0 -232
- package/lib/hooks/dataflow-monitor.js +0 -38
- package/lib/hooks/encoding.js +0 -88
- package/lib/hooks/express-fileupload.js +0 -57
- package/lib/hooks/express-session.js +0 -108
- package/lib/hooks/fn-to-string.js +0 -106
- package/lib/hooks/frameworks/base.js +0 -103
- package/lib/hooks/frameworks/common.js +0 -191
- package/lib/hooks/frameworks/hapi16.js +0 -293
- package/lib/hooks/frameworks/http.js +0 -89
- package/lib/hooks/frameworks/http2.js +0 -73
- package/lib/hooks/frameworks/index.js +0 -29
- package/lib/hooks/frameworks/spdy.js +0 -87
- package/lib/hooks/hapi-16-reply.js +0 -55
- package/lib/hooks/hapi-16-session.js +0 -312
- package/lib/hooks/http.js +0 -210
- package/lib/hooks/module/extensions.js +0 -41
- package/lib/hooks/module/helpers.js +0 -157
- package/lib/hooks/module/index.js +0 -99
- package/lib/hooks/newrelic.js +0 -60
- package/lib/hooks/object-is.js +0 -48
- package/lib/hooks/object-to-primitive.js +0 -64
- package/lib/hooks/patcher.js +0 -575
- package/lib/hooks/require.js +0 -57
- package/lib/hooks/stealthy-require.js +0 -64
- package/lib/instrumentation.js +0 -190
- package/lib/libraries.js +0 -172
- package/lib/library-usage.js +0 -51
- package/lib/list-installed.js +0 -97
- package/lib/protect/analysis/aho-corasick.js +0 -175
- package/lib/protect/analysis/dfsa-analyzer.js +0 -64
- package/lib/protect/errors/handler-async-errors.js +0 -66
- package/lib/protect/errors/handler.js +0 -55
- package/lib/protect/errors/security-exception.js +0 -31
- package/lib/protect/express/index.js +0 -27
- package/lib/protect/express/sinks.js +0 -34
- package/lib/protect/express/sources.js +0 -54
- package/lib/protect/express/utils.js +0 -60
- package/lib/protect/fastify/index.js +0 -25
- package/lib/protect/fastify/sinks.js +0 -37
- package/lib/protect/fastify/sources.js +0 -90
- package/lib/protect/hapi/error-handler.js +0 -79
- package/lib/protect/hapi/index.js +0 -27
- package/lib/protect/hapi/sinks.js +0 -40
- package/lib/protect/hapi/sources.js +0 -104
- package/lib/protect/index.js +0 -31
- package/lib/protect/input-analysis.js +0 -359
- package/lib/protect/koa/index.js +0 -25
- package/lib/protect/koa/sinks.js +0 -38
- package/lib/protect/koa/sources.js +0 -152
- package/lib/protect/listeners.js +0 -213
- package/lib/protect/loopback4/index.js +0 -23
- package/lib/protect/loopback4/sources.js +0 -48
- package/lib/protect/models/application-context.js +0 -46
- package/lib/protect/models/sink-event.js +0 -28
- package/lib/protect/models/source-event.js +0 -51
- package/lib/protect/restify/index.js +0 -25
- package/lib/protect/restify/sinks.js +0 -39
- package/lib/protect/restify/sources.js +0 -100
- package/lib/protect/rules/assessment.js +0 -204
- package/lib/protect/rules/attack-patterns.js +0 -364
- package/lib/protect/rules/base-scanner/index.js +0 -621
- package/lib/protect/rules/base-scanner/java-script-scanner.js +0 -154
- package/lib/protect/rules/base-scanner/postgresqlscanner.js +0 -26
- package/lib/protect/rules/base-scanner/scan-state.js +0 -243
- package/lib/protect/rules/base-scanner/scan-states.json +0 -14
- package/lib/protect/rules/base-scanner/substring-finder.js +0 -59
- package/lib/protect/rules/base-scanner/token-sequence.js +0 -57
- package/lib/protect/rules/bot-blocker/bot-blocker-rule.js +0 -108
- package/lib/protect/rules/bot-blocker/bots.json +0 -283
- package/lib/protect/rules/bot-blocker/index.js +0 -93
- package/lib/protect/rules/cmd-injection/cmdinjection-rule.js +0 -113
- package/lib/protect/rules/cmd-injection-command-backdoors/backdoor-detector.js +0 -103
- package/lib/protect/rules/cmd-injection-command-backdoors/cmd-injection-command-backdoors-rule.js +0 -90
- package/lib/protect/rules/cmd-injection-semantic-chained-commands/chained-command-scanner.js +0 -278
- package/lib/protect/rules/cmd-injection-semantic-chained-commands/cmd-injection-semantic-chained-commands-rule.js +0 -117
- package/lib/protect/rules/cmd-injection-semantic-dangerous-paths/cmd-injection-semantic-dangerous-paths-rule.js +0 -112
- package/lib/protect/rules/cmd-injection-semantic-dangerous-paths/dangerous-paths-scanner.js +0 -210
- package/lib/protect/rules/common.js +0 -38
- package/lib/protect/rules/index.js +0 -357
- package/lib/protect/rules/ip-denylist/ip-denylist-rule.js +0 -106
- package/lib/protect/rules/method-tampering/evaluator.js +0 -39
- package/lib/protect/rules/method-tampering/method-tampering-rule.js +0 -99
- package/lib/protect/rules/nosqli/nosql-injection-rule.js +0 -307
- package/lib/protect/rules/nosqli/nosql-scanner/index.js +0 -46
- package/lib/protect/rules/nosqli/nosql-scanner/labels.json +0 -73
- package/lib/protect/rules/nosqli/nosql-scanner/mongodbscanner.js +0 -85
- package/lib/protect/rules/nosqli/nosql-scanner/rethinkdbscanner.js +0 -26
- package/lib/protect/rules/path-traversal/path-traversal-rule.js +0 -61
- package/lib/protect/rules/rule-factory.js +0 -250
- package/lib/protect/rules/signatures/cmd-injection/config.json +0 -8
- package/lib/protect/rules/signatures/cmd-injection/custom-searchers/chained-command-searcher.js +0 -117
- package/lib/protect/rules/signatures/cmd-injection/custom-searchers/index.js +0 -26
- package/lib/protect/rules/signatures/cmd-injection/index.js +0 -30
- package/lib/protect/rules/signatures/evaluator.js +0 -187
- package/lib/protect/rules/signatures/index.js +0 -83
- package/lib/protect/rules/signatures/nosql-injection/config.json +0 -8
- package/lib/protect/rules/signatures/nosql-injection/custom-searchers/index.js +0 -28
- package/lib/protect/rules/signatures/nosql-injection/custom-searchers/nosql-comment-searcher.js +0 -42
- package/lib/protect/rules/signatures/nosql-injection/custom-searchers/simple-or-searcher.js +0 -115
- package/lib/protect/rules/signatures/nosql-injection/index.js +0 -30
- package/lib/protect/rules/signatures/path-traversal/config.json +0 -8
- package/lib/protect/rules/signatures/path-traversal/index.js +0 -30
- package/lib/protect/rules/signatures/reflected-xss/config.json +0 -14
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/behavior-url-searcher.js +0 -84
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/custom-searches.json +0 -103
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/function-definition-searcher.js +0 -59
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/immediate-function-searcher.js +0 -105
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/index.js +0 -36
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/link-and-src-target-searcher.js +0 -145
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/location-set-searcher.js +0 -72
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/map-access-searcher.js +0 -102
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/native-function-execution-searcher.js +0 -82
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/no-alnum-searcher.js +0 -50
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/redefined-function-searcher.js +0 -111
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/style-url-injection-searcher.js +0 -65
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/variable-assignment-searcher.js +0 -90
- package/lib/protect/rules/signatures/reflected-xss/helpers/function-call.js +0 -83
- package/lib/protect/rules/signatures/reflected-xss/index.js +0 -30
- package/lib/protect/rules/signatures/signature.js +0 -201
- package/lib/protect/rules/signatures/sql-injection/config.json +0 -10
- package/lib/protect/rules/signatures/sql-injection/custom-searchers/if-else-drop-searcher.js +0 -49
- package/lib/protect/rules/signatures/sql-injection/custom-searchers/index.js +0 -30
- package/lib/protect/rules/signatures/sql-injection/custom-searchers/simple-or-searcher.js +0 -124
- package/lib/protect/rules/signatures/sql-injection/custom-searchers/sql-comment-searcher.js +0 -73
- package/lib/protect/rules/signatures/sql-injection/custom-searchers/time-function-searcher.js +0 -64
- package/lib/protect/rules/signatures/sql-injection/custom-searchers/tsql-exec-searcher.js +0 -45
- package/lib/protect/rules/signatures/sql-injection/index.js +0 -30
- package/lib/protect/rules/signatures/ssjs-injection/config.json +0 -17
- package/lib/protect/rules/signatures/ssjs-injection/index.js +0 -30
- package/lib/protect/rules/signatures/unsafe-file-upload/config.json +0 -7
- package/lib/protect/rules/signatures/unsafe-file-upload/index.js +0 -29
- package/lib/protect/rules/signatures/untrusted-deserialization/config.json +0 -8
- package/lib/protect/rules/signatures/untrusted-deserialization/index.js +0 -27
- package/lib/protect/rules/sqli/generic-complicated.js +0 -50
- package/lib/protect/rules/sqli/sql-injection-rule.js +0 -278
- package/lib/protect/rules/sqli/sql-scanner/index.js +0 -61
- package/lib/protect/rules/sqli/sql-scanner/labels.json +0 -135
- package/lib/protect/rules/sqli/sql-scanner/mysql-scanner.js +0 -170
- package/lib/protect/rules/ssjs-injection/evaluator.js +0 -48
- package/lib/protect/rules/ssjs-injection/ssjsinjection-rule.js +0 -164
- package/lib/protect/rules/unsafe-file-upload/unsafe-file-upload-rule.js +0 -33
- package/lib/protect/rules/untrusted-deserialization/untrusted-deserialization-rule.js +0 -95
- package/lib/protect/rules/virtual-patch/index.js +0 -17
- package/lib/protect/rules/virtual-patch/utils.js +0 -72
- package/lib/protect/rules/virtual-patch/virtual-patch-rule.js +0 -162
- package/lib/protect/rules/xss/helpers/function-call.js +0 -82
- package/lib/protect/rules/xss/reflected-xss-rule.js +0 -103
- package/lib/protect/rules/xxe/xxerule.js +0 -184
- package/lib/protect/sample-aggregator.js +0 -144
- package/lib/protect/samples.js +0 -167
- package/lib/protect/service.js +0 -1203
- package/lib/protect/sinks/child-process.js +0 -65
- package/lib/protect/sinks/eval.js +0 -57
- package/lib/protect/sinks/fs.js +0 -97
- package/lib/protect/sinks/function.js +0 -64
- package/lib/protect/sinks/index.js +0 -54
- package/lib/protect/sinks/libxmljs.js +0 -107
- package/lib/protect/sinks/mongodb.js +0 -158
- package/lib/protect/sinks/mysql.js +0 -63
- package/lib/protect/sinks/node-serialize.js +0 -53
- package/lib/protect/sinks/postgres.js +0 -81
- package/lib/protect/sinks/rethinkdb.js +0 -47
- package/lib/protect/sinks/sequelize.js +0 -86
- package/lib/protect/sinks/sqlite3.js +0 -50
- package/lib/protect/sinks/vm.js +0 -89
- package/lib/protect/sources/busboy.js +0 -58
- package/lib/protect/sources/formidable.js +0 -55
- package/lib/protect/sources/index.js +0 -27
- package/lib/protect/validators/authorization.js +0 -31
- package/lib/protect/validators/common.js +0 -74
- package/lib/protect/validators/connection.js +0 -31
- package/lib/protect/validators/content-length.js +0 -30
- package/lib/protect/validators/host.js +0 -23
- package/lib/protect/validators/if-none-match.js +0 -71
- package/lib/protect/validators/index.js +0 -24
- package/lib/protect/validators/origin.js +0 -29
- package/lib/reporter/app-activity-queue.js +0 -179
- package/lib/reporter/grpc-client.js +0 -88
- package/lib/reporter/messages/speedracer/activity.js +0 -38
- package/lib/reporter/messages/speedracer/application-create.js +0 -65
- package/lib/reporter/messages/speedracer/application-update.js +0 -41
- package/lib/reporter/messages/speedracer/base.js +0 -401
- package/lib/reporter/messages/speedracer/index.js +0 -33
- package/lib/reporter/messages/speedracer/observed-route.js +0 -41
- package/lib/reporter/messages/speedracer/poll.js +0 -43
- package/lib/reporter/messages/speedracer/request.js +0 -33
- package/lib/reporter/messages/speedracer/startup.js +0 -63
- package/lib/reporter/messaging-router.js +0 -116
- package/lib/reporter/models/app-activity/app-activity.js +0 -43
- package/lib/reporter/models/app-activity/attacker-activity.js +0 -77
- package/lib/reporter/models/app-activity/defend.js +0 -94
- package/lib/reporter/models/app-activity/inventory.js +0 -73
- package/lib/reporter/models/app-activity/protection-rule-activity.js +0 -68
- package/lib/reporter/models/app-activity/rule-events.js +0 -55
- package/lib/reporter/models/app-activity/sample.js +0 -139
- package/lib/reporter/models/app-activity/source.js +0 -79
- package/lib/reporter/models/app-activity/user-input.js +0 -87
- package/lib/reporter/models/app-create.js +0 -63
- package/lib/reporter/models/app-update/index.js +0 -178
- package/lib/reporter/models/app-update/library-manifest.js +0 -54
- package/lib/reporter/models/app-update/library-usage.js +0 -36
- package/lib/reporter/models/app-update/library.js +0 -165
- package/lib/reporter/models/event-tag.js +0 -36
- package/lib/reporter/models/finding/event.js +0 -158
- package/lib/reporter/models/finding/finding.js +0 -77
- package/lib/reporter/models/frameworks/express-request.js +0 -75
- package/lib/reporter/models/frameworks/fastify-request.js +0 -27
- package/lib/reporter/models/frameworks/hapi-request.js +0 -39
- package/lib/reporter/models/frameworks/index.js +0 -21
- package/lib/reporter/models/frameworks/koa-request.js +0 -27
- package/lib/reporter/models/frameworks/restify-request.js +0 -27
- package/lib/reporter/models/observed-route.js +0 -37
- package/lib/reporter/models/request.js +0 -288
- package/lib/reporter/models/route-coverage.js +0 -53
- package/lib/reporter/models/startup.js +0 -56
- package/lib/reporter/models/trace-event-source.js +0 -38
- package/lib/reporter/models/utils/request-factory.js +0 -32
- package/lib/reporter/models/utils/user-input-factory.js +0 -190
- package/lib/reporter/models/utils/user-input-kit.js +0 -48
- package/lib/reporter/mq-client.js +0 -59
- package/lib/reporter/server-activity-queue.js +0 -37
- package/lib/reporter/socket-client.js +0 -172
- package/lib/reporter/speedracer/base-connection-state.js +0 -49
- package/lib/reporter/speedracer/constants.js +0 -68
- package/lib/reporter/speedracer/failure-connection-state.js +0 -45
- package/lib/reporter/speedracer/index.js +0 -330
- package/lib/reporter/speedracer/success-connection-state.js +0 -67
- package/lib/reporter/speedracer/unknown-connection-state.js +0 -154
- package/lib/reporter/translations/enums.js +0 -268
- package/lib/reporter/translations/helpers.js +0 -115
- package/lib/reporter/translations/to-protobuf/dtm/activity.js +0 -149
- package/lib/reporter/translations/to-protobuf/dtm/address.js +0 -25
- package/lib/reporter/translations/to-protobuf/dtm/agent-startup.js +0 -40
- package/lib/reporter/translations/to-protobuf/dtm/application-create.js +0 -44
- package/lib/reporter/translations/to-protobuf/dtm/application-update.js +0 -61
- package/lib/reporter/translations/to-protobuf/dtm/architecture-component.js +0 -33
- package/lib/reporter/translations/to-protobuf/dtm/attack-result.js +0 -38
- package/lib/reporter/translations/to-protobuf/dtm/bot-blocker-details.js +0 -23
- package/lib/reporter/translations/to-protobuf/dtm/cmd-injection-details.js +0 -22
- package/lib/reporter/translations/to-protobuf/dtm/cmd-injection-semantic-analysis-details.js +0 -23
- package/lib/reporter/translations/to-protobuf/dtm/finding.js +0 -47
- package/lib/reporter/translations/to-protobuf/dtm/http-method-tampering-details.js +0 -24
- package/lib/reporter/translations/to-protobuf/dtm/http-request.js +0 -50
- package/lib/reporter/translations/to-protobuf/dtm/index.js +0 -48
- package/lib/reporter/translations/to-protobuf/dtm/ip-denylist-details.js +0 -23
- package/lib/reporter/translations/to-protobuf/dtm/library-usage-update.js +0 -32
- package/lib/reporter/translations/to-protobuf/dtm/no-sql-injection-details.js +0 -26
- package/lib/reporter/translations/to-protobuf/dtm/observed-route.js +0 -73
- package/lib/reporter/translations/to-protobuf/dtm/pair.js +0 -24
- package/lib/reporter/translations/to-protobuf/dtm/path-traversal-details.js +0 -22
- package/lib/reporter/translations/to-protobuf/dtm/poll.js +0 -19
- package/lib/reporter/translations/to-protobuf/dtm/rasp-rule-sample.js +0 -134
- package/lib/reporter/translations/to-protobuf/dtm/raw-request.js +0 -105
- package/lib/reporter/translations/to-protobuf/dtm/route-coverage.js +0 -68
- package/lib/reporter/translations/to-protobuf/dtm/simple-pair.js +0 -24
- package/lib/reporter/translations/to-protobuf/dtm/sql-injection-details.js +0 -26
- package/lib/reporter/translations/to-protobuf/dtm/ssjs-injection-details.js +0 -25
- package/lib/reporter/translations/to-protobuf/dtm/stack-trace-element.js +0 -30
- package/lib/reporter/translations/to-protobuf/dtm/trace-event/action.js +0 -21
- package/lib/reporter/translations/to-protobuf/dtm/trace-event/index.js +0 -56
- package/lib/reporter/translations/to-protobuf/dtm/trace-event/parent-object-id.js +0 -23
- package/lib/reporter/translations/to-protobuf/dtm/trace-event/trace-event-object.js +0 -28
- package/lib/reporter/translations/to-protobuf/dtm/trace-event/trace-event-signature.js +0 -37
- package/lib/reporter/translations/to-protobuf/dtm/trace-event/trace-event-source.js +0 -24
- package/lib/reporter/translations/to-protobuf/dtm/trace-event/trace-stack.js +0 -27
- package/lib/reporter/translations/to-protobuf/dtm/trace-event/trace-taint-range.js +0 -24
- package/lib/reporter/translations/to-protobuf/dtm/trace-event/type.js +0 -21
- package/lib/reporter/translations/to-protobuf/dtm/untrusted-deserialization-details.js +0 -24
- package/lib/reporter/translations/to-protobuf/dtm/user-input.js +0 -37
- package/lib/reporter/translations/to-protobuf/dtm/virtual-patch-details.js +0 -23
- package/lib/reporter/translations/to-protobuf/dtm/xss-details.js +0 -34
- package/lib/reporter/translations/to-protobuf/dtm/xxe-details.js +0 -45
- package/lib/reporter/translations/to-protobuf/index.js +0 -18
- package/lib/reporter/translations/to-protobuf/settings/application-settings.js +0 -76
- package/lib/reporter/translations/to-protobuf/settings/assess-features.js +0 -66
- package/lib/reporter/translations/to-protobuf/settings/auth.js +0 -25
- package/lib/reporter/translations/to-protobuf/settings/bot-blocker.js +0 -27
- package/lib/reporter/translations/to-protobuf/settings/custom-rule-feature.js +0 -27
- package/lib/reporter/translations/to-protobuf/settings/defend-features.js +0 -74
- package/lib/reporter/translations/to-protobuf/settings/exclusions.js +0 -98
- package/lib/reporter/translations/to-protobuf/settings/index.js +0 -37
- package/lib/reporter/translations/to-protobuf/settings/input-analysis-result.js +0 -22
- package/lib/reporter/translations/to-protobuf/settings/inventory-features.js +0 -35
- package/lib/reporter/translations/to-protobuf/settings/ip-filter.js +0 -29
- package/lib/reporter/translations/to-protobuf/settings/log-enhancer.js +0 -23
- package/lib/reporter/translations/to-protobuf/settings/protection-rule.js +0 -45
- package/lib/reporter/translations/to-protobuf/settings/reaction.js +0 -29
- package/lib/reporter/translations/to-protobuf/settings/rule-definition.js +0 -59
- package/lib/reporter/translations/to-protobuf/settings/sampling.js +0 -35
- package/lib/reporter/translations/to-protobuf/settings/server-features.js +0 -73
- package/lib/reporter/translations/to-protobuf/settings/syslog.js +0 -62
- package/lib/reporter/translations/to-protobuf/settings/virtual-patch.js +0 -77
- package/lib/reporter/ts-reporter.js +0 -448
- package/lib/telemetry.js +0 -194
- package/lib/tracker.js +0 -156
- package/lib/util/base64.js +0 -23
- package/lib/util/bitset.js +0 -85
- package/lib/util/block-request.js +0 -34
- package/lib/util/callback-resolver.js +0 -37
- package/lib/util/clean-stack.js +0 -308
- package/lib/util/clean-string/brackets.js +0 -86
- package/lib/util/clean-string/clean-string-base.js +0 -60
- package/lib/util/clean-string/comments.js +0 -107
- package/lib/util/clean-string/concatenations.js +0 -183
- package/lib/util/clean-string/jsclean-string.js +0 -96
- package/lib/util/clean-string/placeholders.js +0 -107
- package/lib/util/clean-string/util.js +0 -69
- package/lib/util/colors.js +0 -28
- package/lib/util/config-diagnostics-utils.js +0 -229
- package/lib/util/file-finder.js +0 -160
- package/lib/util/get-file-type.js +0 -43
- package/lib/util/heap-dump.js +0 -72
- package/lib/util/html-util.js +0 -83
- package/lib/util/ip-analyzer.js +0 -246
- package/lib/util/is-agent-path.js +0 -25
- package/lib/util/is-contrast-error.js +0 -15
- package/lib/util/is-piped-to-dev.js +0 -16
- package/lib/util/is-string.js +0 -24
- package/lib/util/partial.js +0 -29
- package/lib/util/pkg-name.js +0 -23
- package/lib/util/request-util.js +0 -74
- package/lib/util/resolve-obj.js +0 -39
- package/lib/util/route-info.js +0 -50
- package/lib/util/some.js +0 -27
- package/lib/util/source-map.js +0 -171
- package/lib/util/static-rules.js +0 -33
- package/lib/util/trace-util.js +0 -74
- package/lib/util/traverse.js +0 -188
- package/lib/util/user-input-evaluator.js +0 -64
- package/lib/util/xml-analyzer/external-entity-finder.js +0 -183
- package/node_modules/@colors/colors/LICENSE +0 -26
- package/node_modules/@colors/colors/README.md +0 -219
- package/node_modules/@colors/colors/examples/normal-usage.js +0 -83
- package/node_modules/@colors/colors/examples/safe-string.js +0 -80
- package/node_modules/@colors/colors/index.d.ts +0 -136
- package/node_modules/@colors/colors/lib/colors.js +0 -211
- package/node_modules/@colors/colors/lib/custom/trap.js +0 -46
- package/node_modules/@colors/colors/lib/custom/zalgo.js +0 -110
- package/node_modules/@colors/colors/lib/extendStringPrototype.js +0 -110
- package/node_modules/@colors/colors/lib/index.js +0 -13
- package/node_modules/@colors/colors/lib/maps/america.js +0 -10
- package/node_modules/@colors/colors/lib/maps/rainbow.js +0 -12
- package/node_modules/@colors/colors/lib/maps/random.js +0 -11
- package/node_modules/@colors/colors/lib/maps/zebra.js +0 -5
- package/node_modules/@colors/colors/lib/styles.js +0 -95
- package/node_modules/@colors/colors/lib/system/has-flag.js +0 -35
- package/node_modules/@colors/colors/lib/system/supports-colors.js +0 -151
- package/node_modules/@colors/colors/package.json +0 -49
- package/node_modules/@colors/colors/safe.d.ts +0 -48
- package/node_modules/@colors/colors/safe.js +0 -10
- package/node_modules/@colors/colors/themes/generic-logging.js +0 -12
- package/node_modules/@dabh/diagnostics/CHANGELOG.md +0 -26
- package/node_modules/@dabh/diagnostics/LICENSE +0 -20
- package/node_modules/@dabh/diagnostics/README.md +0 -473
- package/node_modules/@dabh/diagnostics/adapters/hash.js +0 -11
- package/node_modules/@dabh/diagnostics/adapters/index.js +0 -18
- package/node_modules/@dabh/diagnostics/adapters/localstorage.js +0 -11
- package/node_modules/@dabh/diagnostics/adapters/process.env.js +0 -11
- package/node_modules/@dabh/diagnostics/browser/development.js +0 -35
- package/node_modules/@dabh/diagnostics/browser/index.js +0 -8
- package/node_modules/@dabh/diagnostics/browser/override.js +0 -6
- package/node_modules/@dabh/diagnostics/browser/production.js +0 -24
- package/node_modules/@dabh/diagnostics/diagnostics.js +0 -212
- package/node_modules/@dabh/diagnostics/logger/console.js +0 -19
- package/node_modules/@dabh/diagnostics/modifiers/namespace-ansi.js +0 -20
- package/node_modules/@dabh/diagnostics/modifiers/namespace.js +0 -32
- package/node_modules/@dabh/diagnostics/node/development.js +0 -36
- package/node_modules/@dabh/diagnostics/node/index.js +0 -8
- package/node_modules/@dabh/diagnostics/node/override.js +0 -21
- package/node_modules/@dabh/diagnostics/node/production.js +0 -24
- package/node_modules/@dabh/diagnostics/package.json +0 -68
- package/node_modules/async/CHANGELOG.md +0 -344
- package/node_modules/async/LICENSE +0 -19
- package/node_modules/async/README.md +0 -60
- package/node_modules/async/all.js +0 -119
- package/node_modules/async/allLimit.js +0 -46
- package/node_modules/async/allSeries.js +0 -45
- package/node_modules/async/any.js +0 -122
- package/node_modules/async/anyLimit.js +0 -47
- package/node_modules/async/anySeries.js +0 -46
- package/node_modules/async/apply.js +0 -55
- package/node_modules/async/applyEach.js +0 -57
- package/node_modules/async/applyEachSeries.js +0 -37
- package/node_modules/async/asyncify.js +0 -118
- package/node_modules/async/auto.js +0 -333
- package/node_modules/async/autoInject.js +0 -182
- package/node_modules/async/bower.json +0 -17
- package/node_modules/async/cargo.js +0 -63
- package/node_modules/async/cargoQueue.js +0 -71
- package/node_modules/async/compose.js +0 -55
- package/node_modules/async/concat.js +0 -115
- package/node_modules/async/concatLimit.js +0 -60
- package/node_modules/async/concatSeries.js +0 -41
- package/node_modules/async/constant.js +0 -55
- package/node_modules/async/detect.js +0 -96
- package/node_modules/async/detectLimit.js +0 -48
- package/node_modules/async/detectSeries.js +0 -47
- package/node_modules/async/dir.js +0 -43
- package/node_modules/async/dist/async.js +0 -6057
- package/node_modules/async/dist/async.min.js +0 -1
- package/node_modules/async/dist/async.mjs +0 -5945
- package/node_modules/async/doDuring.js +0 -68
- package/node_modules/async/doUntil.js +0 -46
- package/node_modules/async/doWhilst.js +0 -68
- package/node_modules/async/during.js +0 -78
- package/node_modules/async/each.js +0 -129
- package/node_modules/async/eachLimit.js +0 -50
- package/node_modules/async/eachOf.js +0 -185
- package/node_modules/async/eachOfLimit.js +0 -47
- package/node_modules/async/eachOfSeries.js +0 -39
- package/node_modules/async/eachSeries.js +0 -44
- package/node_modules/async/ensureAsync.js +0 -67
- package/node_modules/async/every.js +0 -119
- package/node_modules/async/everyLimit.js +0 -46
- package/node_modules/async/everySeries.js +0 -45
- package/node_modules/async/filter.js +0 -93
- package/node_modules/async/filterLimit.js +0 -45
- package/node_modules/async/filterSeries.js +0 -43
- package/node_modules/async/find.js +0 -96
- package/node_modules/async/findLimit.js +0 -48
- package/node_modules/async/findSeries.js +0 -47
- package/node_modules/async/flatMap.js +0 -115
- package/node_modules/async/flatMapLimit.js +0 -60
- package/node_modules/async/flatMapSeries.js +0 -41
- package/node_modules/async/foldl.js +0 -153
- package/node_modules/async/foldr.js +0 -41
- package/node_modules/async/forEach.js +0 -129
- package/node_modules/async/forEachLimit.js +0 -50
- package/node_modules/async/forEachOf.js +0 -185
- package/node_modules/async/forEachOfLimit.js +0 -47
- package/node_modules/async/forEachOfSeries.js +0 -39
- package/node_modules/async/forEachSeries.js +0 -44
- package/node_modules/async/forever.js +0 -68
- package/node_modules/async/groupBy.js +0 -108
- package/node_modules/async/groupByLimit.js +0 -71
- package/node_modules/async/groupBySeries.js +0 -36
- package/node_modules/async/index.js +0 -588
- package/node_modules/async/inject.js +0 -153
- package/node_modules/async/internal/DoublyLinkedList.js +0 -92
- package/node_modules/async/internal/Heap.js +0 -120
- package/node_modules/async/internal/applyEach.js +0 -29
- package/node_modules/async/internal/asyncEachOfLimit.js +0 -75
- package/node_modules/async/internal/awaitify.js +0 -27
- package/node_modules/async/internal/breakLoop.js +0 -10
- package/node_modules/async/internal/consoleFunc.js +0 -31
- package/node_modules/async/internal/createTester.js +0 -40
- package/node_modules/async/internal/eachOfLimit.js +0 -90
- package/node_modules/async/internal/filter.js +0 -55
- package/node_modules/async/internal/getIterator.js +0 -11
- package/node_modules/async/internal/initialParams.js +0 -14
- package/node_modules/async/internal/isArrayLike.js +0 -10
- package/node_modules/async/internal/iterator.js +0 -57
- package/node_modules/async/internal/map.js +0 -30
- package/node_modules/async/internal/once.js +0 -17
- package/node_modules/async/internal/onlyOnce.js +0 -15
- package/node_modules/async/internal/parallel.js +0 -34
- package/node_modules/async/internal/promiseCallback.js +0 -23
- package/node_modules/async/internal/queue.js +0 -291
- package/node_modules/async/internal/range.js +0 -14
- package/node_modules/async/internal/reject.js +0 -26
- package/node_modules/async/internal/setImmediate.js +0 -34
- package/node_modules/async/internal/withoutIndex.js +0 -10
- package/node_modules/async/internal/wrapAsync.js +0 -34
- package/node_modules/async/log.js +0 -41
- package/node_modules/async/map.js +0 -142
- package/node_modules/async/mapLimit.js +0 -45
- package/node_modules/async/mapSeries.js +0 -44
- package/node_modules/async/mapValues.js +0 -152
- package/node_modules/async/mapValuesLimit.js +0 -61
- package/node_modules/async/mapValuesSeries.js +0 -37
- package/node_modules/async/memoize.js +0 -91
- package/node_modules/async/nextTick.js +0 -52
- package/node_modules/async/package.json +0 -84
- package/node_modules/async/parallel.js +0 -180
- package/node_modules/async/parallelLimit.js +0 -41
- package/node_modules/async/priorityQueue.js +0 -91
- package/node_modules/async/queue.js +0 -167
- package/node_modules/async/race.js +0 -67
- package/node_modules/async/reduce.js +0 -153
- package/node_modules/async/reduceRight.js +0 -41
- package/node_modules/async/reflect.js +0 -78
- package/node_modules/async/reflectAll.js +0 -93
- package/node_modules/async/reject.js +0 -87
- package/node_modules/async/rejectLimit.js +0 -45
- package/node_modules/async/rejectSeries.js +0 -43
- package/node_modules/async/retry.js +0 -159
- package/node_modules/async/retryable.js +0 -77
- package/node_modules/async/select.js +0 -93
- package/node_modules/async/selectLimit.js +0 -45
- package/node_modules/async/selectSeries.js +0 -43
- package/node_modules/async/seq.js +0 -79
- package/node_modules/async/series.js +0 -186
- package/node_modules/async/setImmediate.js +0 -45
- package/node_modules/async/some.js +0 -122
- package/node_modules/async/someLimit.js +0 -47
- package/node_modules/async/someSeries.js +0 -46
- package/node_modules/async/sortBy.js +0 -190
- package/node_modules/async/timeout.js +0 -89
- package/node_modules/async/times.js +0 -50
- package/node_modules/async/timesLimit.js +0 -43
- package/node_modules/async/timesSeries.js +0 -32
- package/node_modules/async/transform.js +0 -173
- package/node_modules/async/tryEach.js +0 -78
- package/node_modules/async/unmemoize.js +0 -25
- package/node_modules/async/until.js +0 -61
- package/node_modules/async/waterfall.js +0 -105
- package/node_modules/async/whilst.js +0 -78
- package/node_modules/async/wrapSync.js +0 -118
- package/node_modules/color/LICENSE +0 -21
- package/node_modules/color/README.md +0 -123
- package/node_modules/color/index.js +0 -482
- package/node_modules/color/package.json +0 -44
- package/node_modules/color-convert/CHANGELOG.md +0 -54
- package/node_modules/color-convert/LICENSE +0 -21
- package/node_modules/color-convert/README.md +0 -68
- package/node_modules/color-convert/conversions.js +0 -868
- package/node_modules/color-convert/index.js +0 -78
- package/node_modules/color-convert/package.json +0 -50
- package/node_modules/color-convert/route.js +0 -97
- package/node_modules/color-name/.eslintrc.json +0 -43
- package/node_modules/color-name/.npmignore +0 -107
- package/node_modules/color-name/LICENSE +0 -8
- package/node_modules/color-name/README.md +0 -11
- package/node_modules/color-name/index.js +0 -152
- package/node_modules/color-name/package.json +0 -29
- package/node_modules/color-name/test.js +0 -7
- package/node_modules/color-string/LICENSE +0 -21
- package/node_modules/color-string/README.md +0 -62
- package/node_modules/color-string/index.js +0 -242
- package/node_modules/color-string/package.json +0 -43
- package/node_modules/colors/LICENSE +0 -25
- package/node_modules/colors/README.md +0 -221
- package/node_modules/colors/examples/normal-usage.js +0 -82
- package/node_modules/colors/examples/safe-string.js +0 -79
- package/node_modules/colors/index.d.ts +0 -136
- package/node_modules/colors/lib/colors.js +0 -211
- package/node_modules/colors/lib/custom/trap.js +0 -46
- package/node_modules/colors/lib/custom/zalgo.js +0 -110
- package/node_modules/colors/lib/extendStringPrototype.js +0 -110
- package/node_modules/colors/lib/index.js +0 -13
- package/node_modules/colors/lib/maps/america.js +0 -10
- package/node_modules/colors/lib/maps/rainbow.js +0 -12
- package/node_modules/colors/lib/maps/random.js +0 -11
- package/node_modules/colors/lib/maps/zebra.js +0 -5
- package/node_modules/colors/lib/styles.js +0 -95
- package/node_modules/colors/lib/system/has-flag.js +0 -35
- package/node_modules/colors/lib/system/supports-colors.js +0 -151
- package/node_modules/colors/package.json +0 -49
- package/node_modules/colors/safe.d.ts +0 -48
- package/node_modules/colors/safe.js +0 -10
- package/node_modules/colors/themes/generic-logging.js +0 -12
- package/node_modules/colorspace/LICENSE.md +0 -20
- package/node_modules/colorspace/README.md +0 -43
- package/node_modules/colorspace/index.js +0 -29
- package/node_modules/colorspace/package.json +0 -41
- package/node_modules/core-util-is/LICENSE +0 -19
- package/node_modules/core-util-is/README.md +0 -3
- package/node_modules/core-util-is/float.patch +0 -604
- package/node_modules/core-util-is/lib/util.js +0 -107
- package/node_modules/core-util-is/package.json +0 -36
- package/node_modules/core-util-is/test.js +0 -68
- package/node_modules/cycle/README.md +0 -49
- package/node_modules/cycle/cycle.js +0 -170
- package/node_modules/cycle/package.json +0 -16
- package/node_modules/enabled/.travis.yml +0 -9
- package/node_modules/enabled/LICENSE +0 -20
- package/node_modules/enabled/README.md +0 -68
- package/node_modules/enabled/index.js +0 -34
- package/node_modules/enabled/package.json +0 -37
- package/node_modules/enabled/test.js +0 -39
- package/node_modules/fast-safe-stringify/.travis.yml +0 -8
- package/node_modules/fast-safe-stringify/CHANGELOG.md +0 -17
- package/node_modules/fast-safe-stringify/LICENSE +0 -23
- package/node_modules/fast-safe-stringify/benchmark.js +0 -137
- package/node_modules/fast-safe-stringify/index.d.ts +0 -8
- package/node_modules/fast-safe-stringify/index.js +0 -161
- package/node_modules/fast-safe-stringify/package.json +0 -50
- package/node_modules/fast-safe-stringify/readme.md +0 -154
- package/node_modules/fast-safe-stringify/test-stable.js +0 -311
- package/node_modules/fast-safe-stringify/test.js +0 -304
- package/node_modules/fecha/LICENSE +0 -22
- package/node_modules/fecha/README.md +0 -320
- package/node_modules/fecha/dist/fecha.min.js +0 -2
- package/node_modules/fecha/dist/fecha.min.js.map +0 -1
- package/node_modules/fecha/lib/fecha.d.ts +0 -52
- package/node_modules/fecha/lib/fecha.js +0 -403
- package/node_modules/fecha/lib/fecha.js.map +0 -1
- package/node_modules/fecha/lib/fecha.umd.js +0 -418
- package/node_modules/fecha/lib/fecha.umd.js.map +0 -1
- package/node_modules/fecha/package.json +0 -59
- package/node_modules/fecha/src/fecha.ts +0 -524
- package/node_modules/file-stream-rotator/.nvmrc +0 -1
- package/node_modules/file-stream-rotator/.travis.yml +0 -5
- package/node_modules/file-stream-rotator/FileStreamRotator.js +0 -543
- package/node_modules/file-stream-rotator/README.md +0 -133
- package/node_modules/file-stream-rotator/index.js +0 -1
- package/node_modules/file-stream-rotator/package.json +0 -34
- package/node_modules/file-stream-rotator/test.js +0 -208
- package/node_modules/file-stream-rotator/tests/every-minute-test.js +0 -68
- package/node_modules/file-stream-rotator/tests/every-second-test.js +0 -66
- package/node_modules/fn.name/.gitattributes +0 -1
- package/node_modules/fn.name/.travis.yml +0 -10
- package/node_modules/fn.name/LICENSE +0 -22
- package/node_modules/fn.name/README.md +0 -42
- package/node_modules/fn.name/index.js +0 -42
- package/node_modules/fn.name/package.json +0 -41
- package/node_modules/fn.name/test.js +0 -73
- package/node_modules/inherits/LICENSE +0 -16
- package/node_modules/inherits/README.md +0 -42
- package/node_modules/inherits/inherits.js +0 -9
- package/node_modules/inherits/inherits_browser.js +0 -27
- package/node_modules/inherits/package.json +0 -33
- package/node_modules/is-arrayish/LICENSE +0 -21
- package/node_modules/is-arrayish/README.md +0 -16
- package/node_modules/is-arrayish/index.js +0 -9
- package/node_modules/is-arrayish/package.json +0 -49
- package/node_modules/is-arrayish/yarn-error.log +0 -1443
- package/node_modules/is-stream/index.d.ts +0 -80
- package/node_modules/is-stream/index.js +0 -29
- package/node_modules/is-stream/license +0 -9
- package/node_modules/is-stream/package.json +0 -45
- package/node_modules/is-stream/readme.md +0 -57
- package/node_modules/isarray/.npmignore +0 -1
- package/node_modules/isarray/.travis.yml +0 -4
- package/node_modules/isarray/Makefile +0 -6
- package/node_modules/isarray/README.md +0 -60
- package/node_modules/isarray/component.json +0 -19
- package/node_modules/isarray/index.js +0 -5
- package/node_modules/isarray/package.json +0 -49
- package/node_modules/isarray/test.js +0 -20
- package/node_modules/kuler/.travis.yml +0 -5
- package/node_modules/kuler/LICENSE +0 -7
- package/node_modules/kuler/README.md +0 -40
- package/node_modules/kuler/index.js +0 -118
- package/node_modules/kuler/package.json +0 -38
- package/node_modules/kuler/test.js +0 -23
- package/node_modules/logform/.babelrc +0 -3
- package/node_modules/logform/.eslintrc +0 -7
- package/node_modules/logform/.gitattributes +0 -1
- package/node_modules/logform/CHANGELOG.md +0 -256
- package/node_modules/logform/LICENSE +0 -21
- package/node_modules/logform/README.md +0 -653
- package/node_modules/logform/align.js +0 -14
- package/node_modules/logform/browser.js +0 -38
- package/node_modules/logform/cli.js +0 -52
- package/node_modules/logform/colorize.js +0 -122
- package/node_modules/logform/combine.js +0 -66
- package/node_modules/logform/dist/align.js +0 -15
- package/node_modules/logform/dist/browser.js +0 -72
- package/node_modules/logform/dist/cli.js +0 -73
- package/node_modules/logform/dist/colorize.js +0 -144
- package/node_modules/logform/dist/combine.js +0 -71
- package/node_modules/logform/dist/errors.js +0 -43
- package/node_modules/logform/dist/format.js +0 -91
- package/node_modules/logform/dist/index.js +0 -87
- package/node_modules/logform/dist/json.js +0 -34
- package/node_modules/logform/dist/label.js +0 -20
- package/node_modules/logform/dist/levels.js +0 -14
- package/node_modules/logform/dist/logstash.js +0 -34
- package/node_modules/logform/dist/metadata.js +0 -64
- package/node_modules/logform/dist/ms.js +0 -21
- package/node_modules/logform/dist/pad-levels.js +0 -127
- package/node_modules/logform/dist/pretty-print.js +0 -34
- package/node_modules/logform/dist/printf.js +0 -41
- package/node_modules/logform/dist/simple.js +0 -37
- package/node_modules/logform/dist/splat.js +0 -159
- package/node_modules/logform/dist/timestamp.js +0 -32
- package/node_modules/logform/dist/uncolorize.js +0 -31
- package/node_modules/logform/errors.js +0 -39
- package/node_modules/logform/examples/combine.js +0 -14
- package/node_modules/logform/examples/filter.js +0 -30
- package/node_modules/logform/examples/invalid.js +0 -6
- package/node_modules/logform/examples/metadata.js +0 -78
- package/node_modules/logform/examples/padLevels.js +0 -39
- package/node_modules/logform/examples/volume.js +0 -25
- package/node_modules/logform/format.js +0 -52
- package/node_modules/logform/index.d.ts +0 -197
- package/node_modules/logform/index.js +0 -52
- package/node_modules/logform/json.js +0 -30
- package/node_modules/logform/label.js +0 -19
- package/node_modules/logform/levels.js +0 -12
- package/node_modules/logform/logstash.js +0 -29
- package/node_modules/logform/metadata.js +0 -61
- package/node_modules/logform/ms.js +0 -18
- package/node_modules/logform/package.json +0 -53
- package/node_modules/logform/pad-levels.js +0 -83
- package/node_modules/logform/pretty-print.js +0 -29
- package/node_modules/logform/printf.js +0 -26
- package/node_modules/logform/simple.js +0 -33
- package/node_modules/logform/splat.js +0 -132
- package/node_modules/logform/timestamp.js +0 -30
- package/node_modules/logform/tsconfig.json +0 -22
- package/node_modules/logform/uncolorize.js +0 -27
- package/node_modules/moment/CHANGELOG.md +0 -988
- package/node_modules/moment/LICENSE +0 -22
- package/node_modules/moment/README.md +0 -55
- package/node_modules/moment/dist/locale/af.js +0 -71
- package/node_modules/moment/dist/locale/ar-dz.js +0 -156
- package/node_modules/moment/dist/locale/ar-kw.js +0 -55
- package/node_modules/moment/dist/locale/ar-ly.js +0 -171
- package/node_modules/moment/dist/locale/ar-ma.js +0 -56
- package/node_modules/moment/dist/locale/ar-sa.js +0 -105
- package/node_modules/moment/dist/locale/ar-tn.js +0 -55
- package/node_modules/moment/dist/locale/ar.js +0 -189
- package/node_modules/moment/dist/locale/az.js +0 -102
- package/node_modules/moment/dist/locale/be.js +0 -142
- package/node_modules/moment/dist/locale/bg.js +0 -87
- package/node_modules/moment/dist/locale/bm.js +0 -52
- package/node_modules/moment/dist/locale/bn-bd.js +0 -129
- package/node_modules/moment/dist/locale/bn.js +0 -119
- package/node_modules/moment/dist/locale/bo.js +0 -124
- package/node_modules/moment/dist/locale/br.js +0 -168
- package/node_modules/moment/dist/locale/bs.js +0 -150
- package/node_modules/moment/dist/locale/ca.js +0 -100
- package/node_modules/moment/dist/locale/cs.js +0 -180
- package/node_modules/moment/dist/locale/cv.js +0 -63
- package/node_modules/moment/dist/locale/cy.js +0 -98
- package/node_modules/moment/dist/locale/da.js +0 -53
- package/node_modules/moment/dist/locale/de-at.js +0 -79
- package/node_modules/moment/dist/locale/de-ch.js +0 -78
- package/node_modules/moment/dist/locale/de.js +0 -78
- package/node_modules/moment/dist/locale/dv.js +0 -90
- package/node_modules/moment/dist/locale/el.js +0 -106
- package/node_modules/moment/dist/locale/en-au.js +0 -68
- package/node_modules/moment/dist/locale/en-ca.js +0 -64
- package/node_modules/moment/dist/locale/en-gb.js +0 -68
- package/node_modules/moment/dist/locale/en-ie.js +0 -68
- package/node_modules/moment/dist/locale/en-il.js +0 -64
- package/node_modules/moment/dist/locale/en-in.js +0 -68
- package/node_modules/moment/dist/locale/en-nz.js +0 -68
- package/node_modules/moment/dist/locale/en-sg.js +0 -68
- package/node_modules/moment/dist/locale/eo.js +0 -68
- package/node_modules/moment/dist/locale/es-do.js +0 -108
- package/node_modules/moment/dist/locale/es-mx.js +0 -110
- package/node_modules/moment/dist/locale/es-us.js +0 -110
- package/node_modules/moment/dist/locale/es.js +0 -110
- package/node_modules/moment/dist/locale/et.js +0 -78
- package/node_modules/moment/dist/locale/eu.js +0 -65
- package/node_modules/moment/dist/locale/fa.js +0 -113
- package/node_modules/moment/dist/locale/fi.js +0 -124
- package/node_modules/moment/dist/locale/fil.js +0 -58
- package/node_modules/moment/dist/locale/fo.js +0 -57
- package/node_modules/moment/dist/locale/fr-ca.js +0 -70
- package/node_modules/moment/dist/locale/fr-ch.js +0 -74
- package/node_modules/moment/dist/locale/fr.js +0 -108
- package/node_modules/moment/dist/locale/fy.js +0 -75
- package/node_modules/moment/dist/locale/ga.js +0 -95
- package/node_modules/moment/dist/locale/gd.js +0 -95
- package/node_modules/moment/dist/locale/gl.js +0 -75
- package/node_modules/moment/dist/locale/gom-deva.js +0 -126
- package/node_modules/moment/dist/locale/gom-latn.js +0 -124
- package/node_modules/moment/dist/locale/gu.js +0 -122
- package/node_modules/moment/dist/locale/he.js +0 -94
- package/node_modules/moment/dist/locale/hi.js +0 -168
- package/node_modules/moment/dist/locale/hr.js +0 -156
- package/node_modules/moment/dist/locale/hu.js +0 -118
- package/node_modules/moment/dist/locale/hy-am.js +0 -94
- package/node_modules/moment/dist/locale/id.js +0 -76
- package/node_modules/moment/dist/locale/is.js +0 -140
- package/node_modules/moment/dist/locale/it-ch.js +0 -64
- package/node_modules/moment/dist/locale/it.js +0 -106
- package/node_modules/moment/dist/locale/ja.js +0 -148
- package/node_modules/moment/dist/locale/jv.js +0 -76
- package/node_modules/moment/dist/locale/ka.js +0 -92
- package/node_modules/moment/dist/locale/kk.js +0 -82
- package/node_modules/moment/dist/locale/km.js +0 -103
- package/node_modules/moment/dist/locale/kn.js +0 -124
- package/node_modules/moment/dist/locale/ko.js +0 -75
- package/node_modules/moment/dist/locale/ku.js +0 -118
- package/node_modules/moment/dist/locale/ky.js +0 -84
- package/node_modules/moment/dist/locale/lb.js +0 -137
- package/node_modules/moment/dist/locale/lo.js +0 -66
- package/node_modules/moment/dist/locale/lt.js +0 -125
- package/node_modules/moment/dist/locale/lv.js +0 -94
- package/node_modules/moment/dist/locale/me.js +0 -117
- package/node_modules/moment/dist/locale/mi.js +0 -60
- package/node_modules/moment/dist/locale/mk.js +0 -85
- package/node_modules/moment/dist/locale/ml.js +0 -82
- package/node_modules/moment/dist/locale/mn.js +0 -100
- package/node_modules/moment/dist/locale/mr.js +0 -203
- package/node_modules/moment/dist/locale/ms-my.js +0 -76
- package/node_modules/moment/dist/locale/ms.js +0 -75
- package/node_modules/moment/dist/locale/mt.js +0 -56
- package/node_modules/moment/dist/locale/my.js +0 -91
- package/node_modules/moment/dist/locale/nb.js +0 -60
- package/node_modules/moment/dist/locale/ne.js +0 -121
- package/node_modules/moment/dist/locale/nl-be.js +0 -102
- package/node_modules/moment/dist/locale/nl.js +0 -104
- package/node_modules/moment/dist/locale/nn.js +0 -59
- package/node_modules/moment/dist/locale/oc-lnc.js +0 -85
- package/node_modules/moment/dist/locale/pa-in.js +0 -122
- package/node_modules/moment/dist/locale/pl.js +0 -140
- package/node_modules/moment/dist/locale/pt-br.js +0 -58
- package/node_modules/moment/dist/locale/pt.js +0 -63
- package/node_modules/moment/dist/locale/ro.js +0 -76
- package/node_modules/moment/dist/locale/ru.js +0 -213
- package/node_modules/moment/dist/locale/sd.js +0 -81
- package/node_modules/moment/dist/locale/se.js +0 -57
- package/node_modules/moment/dist/locale/si.js +0 -69
- package/node_modules/moment/dist/locale/sk.js +0 -145
- package/node_modules/moment/dist/locale/sl.js +0 -171
- package/node_modules/moment/dist/locale/sq.js +0 -65
- package/node_modules/moment/dist/locale/sr-cyrl.js +0 -127
- package/node_modules/moment/dist/locale/sr.js +0 -129
- package/node_modules/moment/dist/locale/ss.js +0 -84
- package/node_modules/moment/dist/locale/sv.js +0 -68
- package/node_modules/moment/dist/locale/sw.js +0 -55
- package/node_modules/moment/dist/locale/ta.js +0 -131
- package/node_modules/moment/dist/locale/te.js +0 -88
- package/node_modules/moment/dist/locale/tet.js +0 -68
- package/node_modules/moment/dist/locale/tg.js +0 -117
- package/node_modules/moment/dist/locale/th.js +0 -65
- package/node_modules/moment/dist/locale/tk.js +0 -91
- package/node_modules/moment/dist/locale/tl-ph.js +0 -57
- package/node_modules/moment/dist/locale/tlh.js +0 -124
- package/node_modules/moment/dist/locale/tr.js +0 -106
- package/node_modules/moment/dist/locale/tzl.js +0 -89
- package/node_modules/moment/dist/locale/tzm-latn.js +0 -54
- package/node_modules/moment/dist/locale/tzm.js +0 -54
- package/node_modules/moment/dist/locale/ug-cn.js +0 -111
- package/node_modules/moment/dist/locale/uk.js +0 -167
- package/node_modules/moment/dist/locale/ur.js +0 -82
- package/node_modules/moment/dist/locale/uz-latn.js +0 -54
- package/node_modules/moment/dist/locale/uz.js +0 -51
- package/node_modules/moment/dist/locale/vi.js +0 -80
- package/node_modules/moment/dist/locale/x-pseudo.js +0 -73
- package/node_modules/moment/dist/locale/yo.js +0 -53
- package/node_modules/moment/dist/locale/zh-cn.js +0 -120
- package/node_modules/moment/dist/locale/zh-hk.js +0 -101
- package/node_modules/moment/dist/locale/zh-mo.js +0 -100
- package/node_modules/moment/dist/locale/zh-tw.js +0 -99
- package/node_modules/moment/dist/moment.js +0 -5677
- package/node_modules/moment/ender.js +0 -1
- package/node_modules/moment/locale/af.js +0 -82
- package/node_modules/moment/locale/ar-dz.js +0 -167
- package/node_modules/moment/locale/ar-kw.js +0 -66
- package/node_modules/moment/locale/ar-ly.js +0 -182
- package/node_modules/moment/locale/ar-ma.js +0 -67
- package/node_modules/moment/locale/ar-sa.js +0 -116
- package/node_modules/moment/locale/ar-tn.js +0 -66
- package/node_modules/moment/locale/ar.js +0 -200
- package/node_modules/moment/locale/az.js +0 -113
- package/node_modules/moment/locale/be.js +0 -153
- package/node_modules/moment/locale/bg.js +0 -98
- package/node_modules/moment/locale/bm.js +0 -62
- package/node_modules/moment/locale/bn-bd.js +0 -140
- package/node_modules/moment/locale/bn.js +0 -130
- package/node_modules/moment/locale/bo.js +0 -135
- package/node_modules/moment/locale/br.js +0 -179
- package/node_modules/moment/locale/bs.js +0 -161
- package/node_modules/moment/locale/ca.js +0 -111
- package/node_modules/moment/locale/cs.js +0 -191
- package/node_modules/moment/locale/cv.js +0 -74
- package/node_modules/moment/locale/cy.js +0 -109
- package/node_modules/moment/locale/da.js +0 -64
- package/node_modules/moment/locale/de-at.js +0 -90
- package/node_modules/moment/locale/de-ch.js +0 -87
- package/node_modules/moment/locale/de.js +0 -89
- package/node_modules/moment/locale/dv.js +0 -101
- package/node_modules/moment/locale/el.js +0 -117
- package/node_modules/moment/locale/en-au.js +0 -79
- package/node_modules/moment/locale/en-ca.js +0 -75
- package/node_modules/moment/locale/en-gb.js +0 -79
- package/node_modules/moment/locale/en-ie.js +0 -79
- package/node_modules/moment/locale/en-il.js +0 -75
- package/node_modules/moment/locale/en-in.js +0 -79
- package/node_modules/moment/locale/en-nz.js +0 -79
- package/node_modules/moment/locale/en-sg.js +0 -79
- package/node_modules/moment/locale/eo.js +0 -79
- package/node_modules/moment/locale/es-do.js +0 -119
- package/node_modules/moment/locale/es-mx.js +0 -121
- package/node_modules/moment/locale/es-us.js +0 -121
- package/node_modules/moment/locale/es.js +0 -121
- package/node_modules/moment/locale/et.js +0 -89
- package/node_modules/moment/locale/eu.js +0 -76
- package/node_modules/moment/locale/fa.js +0 -124
- package/node_modules/moment/locale/fi.js +0 -135
- package/node_modules/moment/locale/fil.js +0 -69
- package/node_modules/moment/locale/fo.js +0 -68
- package/node_modules/moment/locale/fr-ca.js +0 -81
- package/node_modules/moment/locale/fr-ch.js +0 -85
- package/node_modules/moment/locale/fr.js +0 -119
- package/node_modules/moment/locale/fy.js +0 -86
- package/node_modules/moment/locale/ga.js +0 -106
- package/node_modules/moment/locale/gd.js +0 -106
- package/node_modules/moment/locale/gl.js +0 -86
- package/node_modules/moment/locale/gom-deva.js +0 -137
- package/node_modules/moment/locale/gom-latn.js +0 -135
- package/node_modules/moment/locale/gu.js +0 -133
- package/node_modules/moment/locale/he.js +0 -105
- package/node_modules/moment/locale/hi.js +0 -179
- package/node_modules/moment/locale/hr.js +0 -167
- package/node_modules/moment/locale/hu.js +0 -129
- package/node_modules/moment/locale/hy-am.js +0 -105
- package/node_modules/moment/locale/id.js +0 -87
- package/node_modules/moment/locale/is.js +0 -151
- package/node_modules/moment/locale/it-ch.js +0 -75
- package/node_modules/moment/locale/it.js +0 -117
- package/node_modules/moment/locale/ja.js +0 -159
- package/node_modules/moment/locale/jv.js +0 -87
- package/node_modules/moment/locale/ka.js +0 -103
- package/node_modules/moment/locale/kk.js +0 -93
- package/node_modules/moment/locale/km.js +0 -114
- package/node_modules/moment/locale/kn.js +0 -135
- package/node_modules/moment/locale/ko.js +0 -86
- package/node_modules/moment/locale/ku.js +0 -129
- package/node_modules/moment/locale/ky.js +0 -95
- package/node_modules/moment/locale/lb.js +0 -148
- package/node_modules/moment/locale/lo.js +0 -77
- package/node_modules/moment/locale/lt.js +0 -136
- package/node_modules/moment/locale/lv.js +0 -105
- package/node_modules/moment/locale/me.js +0 -128
- package/node_modules/moment/locale/mi.js +0 -71
- package/node_modules/moment/locale/mk.js +0 -97
- package/node_modules/moment/locale/ml.js +0 -93
- package/node_modules/moment/locale/mn.js +0 -111
- package/node_modules/moment/locale/mr.js +0 -214
- package/node_modules/moment/locale/ms-my.js +0 -87
- package/node_modules/moment/locale/ms.js +0 -86
- package/node_modules/moment/locale/mt.js +0 -67
- package/node_modules/moment/locale/my.js +0 -102
- package/node_modules/moment/locale/nb.js +0 -71
- package/node_modules/moment/locale/ne.js +0 -132
- package/node_modules/moment/locale/nl-be.js +0 -113
- package/node_modules/moment/locale/nl.js +0 -115
- package/node_modules/moment/locale/nn.js +0 -70
- package/node_modules/moment/locale/oc-lnc.js +0 -96
- package/node_modules/moment/locale/pa-in.js +0 -133
- package/node_modules/moment/locale/pl.js +0 -151
- package/node_modules/moment/locale/pt-br.js +0 -69
- package/node_modules/moment/locale/pt.js +0 -74
- package/node_modules/moment/locale/ro.js +0 -87
- package/node_modules/moment/locale/ru.js +0 -224
- package/node_modules/moment/locale/sd.js +0 -92
- package/node_modules/moment/locale/se.js +0 -68
- package/node_modules/moment/locale/si.js +0 -80
- package/node_modules/moment/locale/sk.js +0 -156
- package/node_modules/moment/locale/sl.js +0 -182
- package/node_modules/moment/locale/sq.js +0 -76
- package/node_modules/moment/locale/sr-cyrl.js +0 -138
- package/node_modules/moment/locale/sr.js +0 -140
- package/node_modules/moment/locale/ss.js +0 -95
- package/node_modules/moment/locale/sv.js +0 -79
- package/node_modules/moment/locale/sw.js +0 -66
- package/node_modules/moment/locale/ta.js +0 -142
- package/node_modules/moment/locale/te.js +0 -99
- package/node_modules/moment/locale/tet.js +0 -79
- package/node_modules/moment/locale/tg.js +0 -128
- package/node_modules/moment/locale/th.js +0 -76
- package/node_modules/moment/locale/tk.js +0 -102
- package/node_modules/moment/locale/tl-ph.js +0 -68
- package/node_modules/moment/locale/tlh.js +0 -135
- package/node_modules/moment/locale/tr.js +0 -117
- package/node_modules/moment/locale/tzl.js +0 -100
- package/node_modules/moment/locale/tzm-latn.js +0 -65
- package/node_modules/moment/locale/tzm.js +0 -65
- package/node_modules/moment/locale/ug-cn.js +0 -122
- package/node_modules/moment/locale/uk.js +0 -178
- package/node_modules/moment/locale/ur.js +0 -93
- package/node_modules/moment/locale/uz-latn.js +0 -65
- package/node_modules/moment/locale/uz.js +0 -62
- package/node_modules/moment/locale/vi.js +0 -91
- package/node_modules/moment/locale/x-pseudo.js +0 -84
- package/node_modules/moment/locale/yo.js +0 -64
- package/node_modules/moment/locale/zh-cn.js +0 -131
- package/node_modules/moment/locale/zh-hk.js +0 -112
- package/node_modules/moment/locale/zh-mo.js +0 -111
- package/node_modules/moment/locale/zh-tw.js +0 -110
- package/node_modules/moment/min/locales.js +0 -12570
- package/node_modules/moment/min/locales.min.js +0 -2
- package/node_modules/moment/min/locales.min.js.map +0 -1
- package/node_modules/moment/min/moment-with-locales.js +0 -18239
- package/node_modules/moment/min/moment-with-locales.min.js +0 -2
- package/node_modules/moment/min/moment-with-locales.min.js.map +0 -1
- package/node_modules/moment/min/moment.min.js +0 -2
- package/node_modules/moment/min/moment.min.js.map +0 -1
- package/node_modules/moment/moment.d.ts +0 -796
- package/node_modules/moment/moment.js +0 -5685
- package/node_modules/moment/package.js +0 -11
- package/node_modules/moment/package.json +0 -116
- package/node_modules/moment/src/lib/create/check-overflow.js +0 -57
- package/node_modules/moment/src/lib/create/date-from-array.js +0 -35
- package/node_modules/moment/src/lib/create/from-anything.js +0 -117
- package/node_modules/moment/src/lib/create/from-array.js +0 -187
- package/node_modules/moment/src/lib/create/from-object.js +0 -20
- package/node_modules/moment/src/lib/create/from-string-and-array.js +0 -67
- package/node_modules/moment/src/lib/create/from-string-and-format.js +0 -135
- package/node_modules/moment/src/lib/create/from-string.js +0 -258
- package/node_modules/moment/src/lib/create/local.js +0 -5
- package/node_modules/moment/src/lib/create/parsing-flags.js +0 -28
- package/node_modules/moment/src/lib/create/utc.js +0 -5
- package/node_modules/moment/src/lib/create/valid.js +0 -51
- package/node_modules/moment/src/lib/duration/abs.js +0 -18
- package/node_modules/moment/src/lib/duration/add-subtract.js +0 -21
- package/node_modules/moment/src/lib/duration/as.js +0 -88
- package/node_modules/moment/src/lib/duration/bubble.js +0 -68
- package/node_modules/moment/src/lib/duration/clone.js +0 -5
- package/node_modules/moment/src/lib/duration/constructor.js +0 -42
- package/node_modules/moment/src/lib/duration/create.js +0 -133
- package/node_modules/moment/src/lib/duration/duration.js +0 -16
- package/node_modules/moment/src/lib/duration/get.js +0 -27
- package/node_modules/moment/src/lib/duration/humanize.js +0 -114
- package/node_modules/moment/src/lib/duration/iso-string.js +0 -68
- package/node_modules/moment/src/lib/duration/prototype.js +0 -78
- package/node_modules/moment/src/lib/duration/valid.js +0 -55
- package/node_modules/moment/src/lib/format/format.js +0 -104
- package/node_modules/moment/src/lib/locale/base-config.js +0 -41
- package/node_modules/moment/src/lib/locale/calendar.js +0 -15
- package/node_modules/moment/src/lib/locale/constructor.js +0 -5
- package/node_modules/moment/src/lib/locale/en.js +0 -39
- package/node_modules/moment/src/lib/locale/formats.js +0 -36
- package/node_modules/moment/src/lib/locale/invalid.js +0 -5
- package/node_modules/moment/src/lib/locale/lists.js +0 -93
- package/node_modules/moment/src/lib/locale/locale.js +0 -45
- package/node_modules/moment/src/lib/locale/locales.js +0 -248
- package/node_modules/moment/src/lib/locale/ordinal.js +0 -8
- package/node_modules/moment/src/lib/locale/pre-post-format.js +0 -3
- package/node_modules/moment/src/lib/locale/prototype.js +0 -88
- package/node_modules/moment/src/lib/locale/relative.js +0 -32
- package/node_modules/moment/src/lib/locale/set.js +0 -56
- package/node_modules/moment/src/lib/moment/add-subtract.js +0 -61
- package/node_modules/moment/src/lib/moment/calendar.js +0 -53
- package/node_modules/moment/src/lib/moment/clone.js +0 -5
- package/node_modules/moment/src/lib/moment/compare.js +0 -72
- package/node_modules/moment/src/lib/moment/constructor.js +0 -80
- package/node_modules/moment/src/lib/moment/creation-data.js +0 -9
- package/node_modules/moment/src/lib/moment/diff.js +0 -79
- package/node_modules/moment/src/lib/moment/format.js +0 -78
- package/node_modules/moment/src/lib/moment/from.js +0 -20
- package/node_modules/moment/src/lib/moment/get-set.js +0 -73
- package/node_modules/moment/src/lib/moment/locale.js +0 -34
- package/node_modules/moment/src/lib/moment/min-max.js +0 -62
- package/node_modules/moment/src/lib/moment/moment.js +0 -28
- package/node_modules/moment/src/lib/moment/now.js +0 -3
- package/node_modules/moment/src/lib/moment/prototype.js +0 -197
- package/node_modules/moment/src/lib/moment/start-end-of.js +0 -164
- package/node_modules/moment/src/lib/moment/to-type.js +0 -42
- package/node_modules/moment/src/lib/moment/to.js +0 -20
- package/node_modules/moment/src/lib/moment/valid.js +0 -15
- package/node_modules/moment/src/lib/parse/regex.js +0 -80
- package/node_modules/moment/src/lib/parse/token.js +0 -36
- package/node_modules/moment/src/lib/units/aliases.js +0 -31
- package/node_modules/moment/src/lib/units/constants.js +0 -9
- package/node_modules/moment/src/lib/units/day-of-month.js +0 -39
- package/node_modules/moment/src/lib/units/day-of-week.js +0 -443
- package/node_modules/moment/src/lib/units/day-of-year.js +0 -37
- package/node_modules/moment/src/lib/units/era.js +0 -287
- package/node_modules/moment/src/lib/units/hour.js +0 -159
- package/node_modules/moment/src/lib/units/millisecond.js +0 -76
- package/node_modules/moment/src/lib/units/minute.js +0 -29
- package/node_modules/moment/src/lib/units/month.js +0 -349
- package/node_modules/moment/src/lib/units/offset.js +0 -249
- package/node_modules/moment/src/lib/units/priorities.js +0 -21
- package/node_modules/moment/src/lib/units/quarter.js +0 -34
- package/node_modules/moment/src/lib/units/second.js +0 -29
- package/node_modules/moment/src/lib/units/timestamp.js +0 -20
- package/node_modules/moment/src/lib/units/timezone.js +0 -16
- package/node_modules/moment/src/lib/units/units.js +0 -20
- package/node_modules/moment/src/lib/units/week-calendar-utils.js +0 -66
- package/node_modules/moment/src/lib/units/week-year.js +0 -138
- package/node_modules/moment/src/lib/units/week.js +0 -69
- package/node_modules/moment/src/lib/units/year.js +0 -85
- package/node_modules/moment/src/lib/utils/abs-ceil.js +0 -7
- package/node_modules/moment/src/lib/utils/abs-floor.js +0 -8
- package/node_modules/moment/src/lib/utils/abs-round.js +0 -7
- package/node_modules/moment/src/lib/utils/compare-arrays.js +0 -18
- package/node_modules/moment/src/lib/utils/defaults.js +0 -10
- package/node_modules/moment/src/lib/utils/deprecate.js +0 -69
- package/node_modules/moment/src/lib/utils/extend.js +0 -19
- package/node_modules/moment/src/lib/utils/has-own-prop.js +0 -3
- package/node_modules/moment/src/lib/utils/hooks.js +0 -13
- package/node_modules/moment/src/lib/utils/index-of.js +0 -18
- package/node_modules/moment/src/lib/utils/is-array.js +0 -6
- package/node_modules/moment/src/lib/utils/is-calendar-spec.js +0 -25
- package/node_modules/moment/src/lib/utils/is-date.js +0 -6
- package/node_modules/moment/src/lib/utils/is-function.js +0 -6
- package/node_modules/moment/src/lib/utils/is-leap-year.js +0 -3
- package/node_modules/moment/src/lib/utils/is-moment-input.js +0 -75
- package/node_modules/moment/src/lib/utils/is-number.js +0 -6
- package/node_modules/moment/src/lib/utils/is-object-empty.js +0 -15
- package/node_modules/moment/src/lib/utils/is-object.js +0 -8
- package/node_modules/moment/src/lib/utils/is-string.js +0 -3
- package/node_modules/moment/src/lib/utils/is-undefined.js +0 -3
- package/node_modules/moment/src/lib/utils/keys.js +0 -20
- package/node_modules/moment/src/lib/utils/map.js +0 -9
- package/node_modules/moment/src/lib/utils/mod.js +0 -3
- package/node_modules/moment/src/lib/utils/some.js +0 -20
- package/node_modules/moment/src/lib/utils/to-int.js +0 -12
- package/node_modules/moment/src/lib/utils/zero-fill.js +0 -10
- package/node_modules/moment/src/locale/af.js +0 -71
- package/node_modules/moment/src/locale/ar-dz.js +0 -156
- package/node_modules/moment/src/locale/ar-kw.js +0 -55
- package/node_modules/moment/src/locale/ar-ly.js +0 -171
- package/node_modules/moment/src/locale/ar-ma.js +0 -56
- package/node_modules/moment/src/locale/ar-sa.js +0 -105
- package/node_modules/moment/src/locale/ar-tn.js +0 -55
- package/node_modules/moment/src/locale/ar.js +0 -189
- package/node_modules/moment/src/locale/az.js +0 -102
- package/node_modules/moment/src/locale/be.js +0 -142
- package/node_modules/moment/src/locale/bg.js +0 -87
- package/node_modules/moment/src/locale/bm.js +0 -52
- package/node_modules/moment/src/locale/bn-bd.js +0 -129
- package/node_modules/moment/src/locale/bn.js +0 -119
- package/node_modules/moment/src/locale/bo.js +0 -124
- package/node_modules/moment/src/locale/br.js +0 -168
- package/node_modules/moment/src/locale/bs.js +0 -150
- package/node_modules/moment/src/locale/ca.js +0 -100
- package/node_modules/moment/src/locale/cs.js +0 -180
- package/node_modules/moment/src/locale/cv.js +0 -63
- package/node_modules/moment/src/locale/cy.js +0 -98
- package/node_modules/moment/src/locale/da.js +0 -53
- package/node_modules/moment/src/locale/de-at.js +0 -79
- package/node_modules/moment/src/locale/de-ch.js +0 -78
- package/node_modules/moment/src/locale/de.js +0 -78
- package/node_modules/moment/src/locale/dv.js +0 -90
- package/node_modules/moment/src/locale/el.js +0 -106
- package/node_modules/moment/src/locale/en-au.js +0 -68
- package/node_modules/moment/src/locale/en-ca.js +0 -64
- package/node_modules/moment/src/locale/en-gb.js +0 -68
- package/node_modules/moment/src/locale/en-ie.js +0 -68
- package/node_modules/moment/src/locale/en-il.js +0 -64
- package/node_modules/moment/src/locale/en-in.js +0 -68
- package/node_modules/moment/src/locale/en-nz.js +0 -68
- package/node_modules/moment/src/locale/en-sg.js +0 -68
- package/node_modules/moment/src/locale/eo.js +0 -68
- package/node_modules/moment/src/locale/es-do.js +0 -108
- package/node_modules/moment/src/locale/es-mx.js +0 -110
- package/node_modules/moment/src/locale/es-us.js +0 -110
- package/node_modules/moment/src/locale/es.js +0 -110
- package/node_modules/moment/src/locale/et.js +0 -78
- package/node_modules/moment/src/locale/eu.js +0 -65
- package/node_modules/moment/src/locale/fa.js +0 -113
- package/node_modules/moment/src/locale/fi.js +0 -124
- package/node_modules/moment/src/locale/fil.js +0 -58
- package/node_modules/moment/src/locale/fo.js +0 -57
- package/node_modules/moment/src/locale/fr-ca.js +0 -70
- package/node_modules/moment/src/locale/fr-ch.js +0 -74
- package/node_modules/moment/src/locale/fr.js +0 -108
- package/node_modules/moment/src/locale/fy.js +0 -75
- package/node_modules/moment/src/locale/ga.js +0 -95
- package/node_modules/moment/src/locale/gd.js +0 -95
- package/node_modules/moment/src/locale/gl.js +0 -75
- package/node_modules/moment/src/locale/gom-deva.js +0 -126
- package/node_modules/moment/src/locale/gom-latn.js +0 -124
- package/node_modules/moment/src/locale/gu.js +0 -122
- package/node_modules/moment/src/locale/he.js +0 -94
- package/node_modules/moment/src/locale/hi.js +0 -168
- package/node_modules/moment/src/locale/hr.js +0 -156
- package/node_modules/moment/src/locale/hu.js +0 -118
- package/node_modules/moment/src/locale/hy-am.js +0 -94
- package/node_modules/moment/src/locale/id.js +0 -76
- package/node_modules/moment/src/locale/is.js +0 -140
- package/node_modules/moment/src/locale/it-ch.js +0 -64
- package/node_modules/moment/src/locale/it.js +0 -106
- package/node_modules/moment/src/locale/ja.js +0 -148
- package/node_modules/moment/src/locale/jv.js +0 -76
- package/node_modules/moment/src/locale/ka.js +0 -92
- package/node_modules/moment/src/locale/kk.js +0 -82
- package/node_modules/moment/src/locale/km.js +0 -103
- package/node_modules/moment/src/locale/kn.js +0 -124
- package/node_modules/moment/src/locale/ko.js +0 -75
- package/node_modules/moment/src/locale/ku.js +0 -118
- package/node_modules/moment/src/locale/ky.js +0 -84
- package/node_modules/moment/src/locale/lb.js +0 -137
- package/node_modules/moment/src/locale/lo.js +0 -66
- package/node_modules/moment/src/locale/lt.js +0 -125
- package/node_modules/moment/src/locale/lv.js +0 -94
- package/node_modules/moment/src/locale/me.js +0 -117
- package/node_modules/moment/src/locale/mi.js +0 -60
- package/node_modules/moment/src/locale/mk.js +0 -85
- package/node_modules/moment/src/locale/ml.js +0 -82
- package/node_modules/moment/src/locale/mn.js +0 -100
- package/node_modules/moment/src/locale/mr.js +0 -203
- package/node_modules/moment/src/locale/ms-my.js +0 -76
- package/node_modules/moment/src/locale/ms.js +0 -75
- package/node_modules/moment/src/locale/mt.js +0 -56
- package/node_modules/moment/src/locale/my.js +0 -91
- package/node_modules/moment/src/locale/nb.js +0 -60
- package/node_modules/moment/src/locale/ne.js +0 -121
- package/node_modules/moment/src/locale/nl-be.js +0 -102
- package/node_modules/moment/src/locale/nl.js +0 -104
- package/node_modules/moment/src/locale/nn.js +0 -59
- package/node_modules/moment/src/locale/oc-lnc.js +0 -85
- package/node_modules/moment/src/locale/pa-in.js +0 -122
- package/node_modules/moment/src/locale/pl.js +0 -140
- package/node_modules/moment/src/locale/pt-br.js +0 -58
- package/node_modules/moment/src/locale/pt.js +0 -63
- package/node_modules/moment/src/locale/ro.js +0 -76
- package/node_modules/moment/src/locale/ru.js +0 -213
- package/node_modules/moment/src/locale/sd.js +0 -81
- package/node_modules/moment/src/locale/se.js +0 -57
- package/node_modules/moment/src/locale/si.js +0 -69
- package/node_modules/moment/src/locale/sk.js +0 -145
- package/node_modules/moment/src/locale/sl.js +0 -171
- package/node_modules/moment/src/locale/sq.js +0 -65
- package/node_modules/moment/src/locale/sr-cyrl.js +0 -127
- package/node_modules/moment/src/locale/sr.js +0 -129
- package/node_modules/moment/src/locale/ss.js +0 -84
- package/node_modules/moment/src/locale/sv.js +0 -68
- package/node_modules/moment/src/locale/sw.js +0 -55
- package/node_modules/moment/src/locale/ta.js +0 -131
- package/node_modules/moment/src/locale/te.js +0 -88
- package/node_modules/moment/src/locale/tet.js +0 -68
- package/node_modules/moment/src/locale/tg.js +0 -117
- package/node_modules/moment/src/locale/th.js +0 -65
- package/node_modules/moment/src/locale/tk.js +0 -91
- package/node_modules/moment/src/locale/tl-ph.js +0 -57
- package/node_modules/moment/src/locale/tlh.js +0 -124
- package/node_modules/moment/src/locale/tr.js +0 -106
- package/node_modules/moment/src/locale/tzl.js +0 -89
- package/node_modules/moment/src/locale/tzm-latn.js +0 -54
- package/node_modules/moment/src/locale/tzm.js +0 -54
- package/node_modules/moment/src/locale/ug-cn.js +0 -111
- package/node_modules/moment/src/locale/uk.js +0 -167
- package/node_modules/moment/src/locale/ur.js +0 -82
- package/node_modules/moment/src/locale/uz-latn.js +0 -54
- package/node_modules/moment/src/locale/uz.js +0 -51
- package/node_modules/moment/src/locale/vi.js +0 -80
- package/node_modules/moment/src/locale/x-pseudo.js +0 -73
- package/node_modules/moment/src/locale/yo.js +0 -53
- package/node_modules/moment/src/locale/zh-cn.js +0 -120
- package/node_modules/moment/src/locale/zh-hk.js +0 -101
- package/node_modules/moment/src/locale/zh-mo.js +0 -100
- package/node_modules/moment/src/locale/zh-tw.js +0 -99
- package/node_modules/moment/src/moment.js +0 -93
- package/node_modules/moment/ts3.1-typings/moment.d.ts +0 -785
- package/node_modules/ms/index.js +0 -162
- package/node_modules/ms/license.md +0 -21
- package/node_modules/ms/package.json +0 -41
- package/node_modules/ms/readme.md +0 -60
- package/node_modules/object-hash/.jshintrc +0 -19
- package/node_modules/object-hash/.travis.yml +0 -35
- package/node_modules/object-hash/LICENSE +0 -22
- package/node_modules/object-hash/bower.json +0 -15
- package/node_modules/object-hash/dist/object_hash.js +0 -2
- package/node_modules/object-hash/dist/object_hash.js.map +0 -1
- package/node_modules/object-hash/dist/object_hash_test.js +0 -4737
- package/node_modules/object-hash/gulpfile.js +0 -97
- package/node_modules/object-hash/index.js +0 -441
- package/node_modules/object-hash/karma.conf.js +0 -69
- package/node_modules/object-hash/package.json +0 -55
- package/node_modules/object-hash/readme.markdown +0 -169
- package/node_modules/object-hash/test/blob.js +0 -41
- package/node_modules/object-hash/test/index.js +0 -290
- package/node_modules/object-hash/test/object-classes.js +0 -106
- package/node_modules/object-hash/test/old-crypto.js +0 -60
- package/node_modules/object-hash/test/replacer.js +0 -36
- package/node_modules/object-hash/test/types.js +0 -174
- package/node_modules/object-hash/test/writeToStream.js +0 -27
- package/node_modules/one-time/LICENSE +0 -22
- package/node_modules/one-time/README.md +0 -88
- package/node_modules/one-time/async.js +0 -43
- package/node_modules/one-time/index.js +0 -42
- package/node_modules/one-time/package.json +0 -38
- package/node_modules/process-nextick-args/index.js +0 -45
- package/node_modules/process-nextick-args/license.md +0 -19
- package/node_modules/process-nextick-args/package.json +0 -29
- package/node_modules/process-nextick-args/readme.md +0 -18
- package/node_modules/readable-stream/.travis.yml +0 -34
- package/node_modules/readable-stream/CONTRIBUTING.md +0 -38
- package/node_modules/readable-stream/GOVERNANCE.md +0 -136
- package/node_modules/readable-stream/LICENSE +0 -47
- package/node_modules/readable-stream/README.md +0 -58
- package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +0 -60
- package/node_modules/readable-stream/duplex-browser.js +0 -1
- package/node_modules/readable-stream/duplex.js +0 -1
- package/node_modules/readable-stream/lib/_stream_duplex.js +0 -131
- package/node_modules/readable-stream/lib/_stream_passthrough.js +0 -47
- package/node_modules/readable-stream/lib/_stream_readable.js +0 -1019
- package/node_modules/readable-stream/lib/_stream_transform.js +0 -214
- package/node_modules/readable-stream/lib/_stream_writable.js +0 -687
- package/node_modules/readable-stream/lib/internal/streams/BufferList.js +0 -79
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -74
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
- package/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
- package/node_modules/readable-stream/package.json +0 -56
- package/node_modules/readable-stream/passthrough.js +0 -1
- package/node_modules/readable-stream/readable-browser.js +0 -7
- package/node_modules/readable-stream/readable.js +0 -19
- package/node_modules/readable-stream/transform.js +0 -1
- package/node_modules/readable-stream/writable-browser.js +0 -1
- package/node_modules/readable-stream/writable.js +0 -8
- package/node_modules/safe-buffer/LICENSE +0 -21
- package/node_modules/safe-buffer/README.md +0 -584
- package/node_modules/safe-buffer/index.d.ts +0 -187
- package/node_modules/safe-buffer/index.js +0 -62
- package/node_modules/safe-buffer/package.json +0 -41
- package/node_modules/safe-stable-stringify/CHANGELOG.md +0 -75
- package/node_modules/safe-stable-stringify/LICENSE +0 -21
- package/node_modules/safe-stable-stringify/esm/package.json +0 -4
- package/node_modules/safe-stable-stringify/esm/wrapper.js +0 -6
- package/node_modules/safe-stable-stringify/index.d.ts +0 -18
- package/node_modules/safe-stable-stringify/index.js +0 -618
- package/node_modules/safe-stable-stringify/package.json +0 -69
- package/node_modules/safe-stable-stringify/readme.md +0 -170
- package/node_modules/safe-stable-stringify/tsconfig.json +0 -22
- package/node_modules/simple-swizzle/LICENSE +0 -21
- package/node_modules/simple-swizzle/README.md +0 -39
- package/node_modules/simple-swizzle/index.js +0 -29
- package/node_modules/simple-swizzle/package.json +0 -40
- package/node_modules/stack-trace/.npmignore +0 -1
- package/node_modules/stack-trace/License +0 -19
- package/node_modules/stack-trace/Makefile +0 -11
- package/node_modules/stack-trace/Readme.md +0 -98
- package/node_modules/stack-trace/lib/stack-trace.js +0 -136
- package/node_modules/stack-trace/package.json +0 -25
- package/node_modules/string_decoder/.travis.yml +0 -50
- package/node_modules/string_decoder/LICENSE +0 -48
- package/node_modules/string_decoder/README.md +0 -47
- package/node_modules/string_decoder/lib/string_decoder.js +0 -296
- package/node_modules/string_decoder/package.json +0 -35
- package/node_modules/text-hex/LICENSE +0 -21
- package/node_modules/text-hex/README.md +0 -20
- package/node_modules/text-hex/index.js +0 -24
- package/node_modules/text-hex/package.json +0 -34
- package/node_modules/text-hex/test.js +0 -11
- package/node_modules/triple-beam/.eslintrc +0 -7
- package/node_modules/triple-beam/.gitattributes +0 -1
- package/node_modules/triple-beam/.travis.yml +0 -17
- package/node_modules/triple-beam/CHANGELOG.md +0 -22
- package/node_modules/triple-beam/LICENSE +0 -21
- package/node_modules/triple-beam/README.md +0 -34
- package/node_modules/triple-beam/config/cli.js +0 -42
- package/node_modules/triple-beam/config/index.js +0 -32
- package/node_modules/triple-beam/config/npm.js +0 -36
- package/node_modules/triple-beam/config/syslog.js +0 -38
- package/node_modules/triple-beam/index.js +0 -46
- package/node_modules/triple-beam/package.json +0 -40
- package/node_modules/triple-beam/test.js +0 -98
- package/node_modules/util-deprecate/History.md +0 -16
- package/node_modules/util-deprecate/LICENSE +0 -24
- package/node_modules/util-deprecate/README.md +0 -53
- package/node_modules/util-deprecate/browser.js +0 -67
- package/node_modules/util-deprecate/node.js +0 -6
- package/node_modules/util-deprecate/package.json +0 -31
- package/node_modules/winston/LICENSE +0 -19
- package/node_modules/winston/README.md +0 -1231
- package/node_modules/winston/dist/winston/common.js +0 -56
- package/node_modules/winston/dist/winston/config/index.js +0 -37
- package/node_modules/winston/dist/winston/container.js +0 -147
- package/node_modules/winston/dist/winston/create-logger.js +0 -145
- package/node_modules/winston/dist/winston/exception-handler.js +0 -288
- package/node_modules/winston/dist/winston/exception-stream.js +0 -94
- package/node_modules/winston/dist/winston/logger.js +0 -766
- package/node_modules/winston/dist/winston/profiler.js +0 -69
- package/node_modules/winston/dist/winston/rejection-handler.js +0 -288
- package/node_modules/winston/dist/winston/tail-file.js +0 -135
- package/node_modules/winston/dist/winston/transports/console.js +0 -166
- package/node_modules/winston/dist/winston/transports/file.js +0 -817
- package/node_modules/winston/dist/winston/transports/http.js +0 -342
- package/node_modules/winston/dist/winston/transports/index.js +0 -55
- package/node_modules/winston/dist/winston/transports/stream.js +0 -117
- package/node_modules/winston/dist/winston.js +0 -166
- package/node_modules/winston/index.d.ts +0 -213
- package/node_modules/winston/lib/winston/common.js +0 -61
- package/node_modules/winston/lib/winston/config/index.d.ts +0 -99
- package/node_modules/winston/lib/winston/config/index.js +0 -35
- package/node_modules/winston/lib/winston/container.js +0 -114
- package/node_modules/winston/lib/winston/create-logger.js +0 -104
- package/node_modules/winston/lib/winston/exception-handler.js +0 -245
- package/node_modules/winston/lib/winston/exception-stream.js +0 -54
- package/node_modules/winston/lib/winston/logger.js +0 -676
- package/node_modules/winston/lib/winston/profiler.js +0 -51
- package/node_modules/winston/lib/winston/rejection-handler.js +0 -251
- package/node_modules/winston/lib/winston/tail-file.js +0 -124
- package/node_modules/winston/lib/winston/transports/console.js +0 -117
- package/node_modules/winston/lib/winston/transports/file.js +0 -695
- package/node_modules/winston/lib/winston/transports/http.js +0 -267
- package/node_modules/winston/lib/winston/transports/index.d.ts +0 -103
- package/node_modules/winston/lib/winston/transports/index.js +0 -56
- package/node_modules/winston/lib/winston/transports/stream.js +0 -63
- package/node_modules/winston/lib/winston.js +0 -176
- package/node_modules/winston/node_modules/readable-stream/CONTRIBUTING.md +0 -38
- package/node_modules/winston/node_modules/readable-stream/GOVERNANCE.md +0 -136
- package/node_modules/winston/node_modules/readable-stream/LICENSE +0 -47
- package/node_modules/winston/node_modules/readable-stream/README.md +0 -106
- package/node_modules/winston/node_modules/readable-stream/errors-browser.js +0 -127
- package/node_modules/winston/node_modules/readable-stream/errors.js +0 -116
- package/node_modules/winston/node_modules/readable-stream/experimentalWarning.js +0 -17
- package/node_modules/winston/node_modules/readable-stream/lib/_stream_duplex.js +0 -139
- package/node_modules/winston/node_modules/readable-stream/lib/_stream_passthrough.js +0 -39
- package/node_modules/winston/node_modules/readable-stream/lib/_stream_readable.js +0 -1124
- package/node_modules/winston/node_modules/readable-stream/lib/_stream_transform.js +0 -201
- package/node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js +0 -697
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/async_iterator.js +0 -207
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -210
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -105
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -104
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/from-browser.js +0 -3
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/from.js +0 -64
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -97
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/state.js +0 -27
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
- package/node_modules/winston/node_modules/readable-stream/package.json +0 -72
- package/node_modules/winston/node_modules/readable-stream/readable-browser.js +0 -9
- package/node_modules/winston/node_modules/readable-stream/readable.js +0 -16
- package/node_modules/winston/node_modules/winston-transport/.babelrc +0 -3
- package/node_modules/winston/node_modules/winston-transport/.eslintrc +0 -7
- package/node_modules/winston/node_modules/winston-transport/.gitattributes +0 -1
- package/node_modules/winston/node_modules/winston-transport/.nyc_output/c3d7ddb9-cc26-466b-a4f6-993ad69e86f6.json +0 -1
- package/node_modules/winston/node_modules/winston-transport/.nyc_output/processinfo/c3d7ddb9-cc26-466b-a4f6-993ad69e86f6.json +0 -1
- package/node_modules/winston/node_modules/winston-transport/.nyc_output/processinfo/index.json +0 -1
- package/node_modules/winston/node_modules/winston-transport/CHANGELOG.md +0 -126
- package/node_modules/winston/node_modules/winston-transport/LICENSE +0 -22
- package/node_modules/winston/node_modules/winston-transport/README.md +0 -50
- package/node_modules/winston/node_modules/winston-transport/dist/index.js +0 -215
- package/node_modules/winston/node_modules/winston-transport/dist/legacy.js +0 -116
- package/node_modules/winston/node_modules/winston-transport/index.d.ts +0 -39
- package/node_modules/winston/node_modules/winston-transport/index.js +0 -215
- package/node_modules/winston/node_modules/winston-transport/legacy.js +0 -119
- package/node_modules/winston/node_modules/winston-transport/package.json +0 -56
- package/node_modules/winston/package.json +0 -78
- package/node_modules/winston-compat/.gitattributes +0 -1
- package/node_modules/winston-compat/.node-version +0 -1
- package/node_modules/winston-compat/CHANGELOG.md +0 -17
- package/node_modules/winston-compat/LICENSE +0 -22
- package/node_modules/winston-compat/README.md +0 -2
- package/node_modules/winston-compat/index.js +0 -295
- package/node_modules/winston-compat/lib/transport.js +0 -135
- package/node_modules/winston-compat/node_modules/fecha/CHANGELOG.md +0 -11
- package/node_modules/winston-compat/node_modules/fecha/LICENSE +0 -22
- package/node_modules/winston-compat/node_modules/fecha/README.md +0 -259
- package/node_modules/winston-compat/node_modules/fecha/fecha.d.ts +0 -47
- package/node_modules/winston-compat/node_modules/fecha/fecha.js +0 -334
- package/node_modules/winston-compat/node_modules/fecha/fecha.min.js +0 -1
- package/node_modules/winston-compat/node_modules/fecha/package.json +0 -44
- package/node_modules/winston-compat/node_modules/logform/.babelrc +0 -3
- package/node_modules/winston-compat/node_modules/logform/.eslintrc +0 -7
- package/node_modules/winston-compat/node_modules/logform/.gitattributes +0 -1
- package/node_modules/winston-compat/node_modules/logform/.travis.yml +0 -17
- package/node_modules/winston-compat/node_modules/logform/CHANGELOG.md +0 -103
- package/node_modules/winston-compat/node_modules/logform/LICENSE +0 -21
- package/node_modules/winston-compat/node_modules/logform/README.md +0 -170
- package/node_modules/winston-compat/node_modules/logform/align.js +0 -14
- package/node_modules/winston-compat/node_modules/logform/browser.js +0 -36
- package/node_modules/winston-compat/node_modules/logform/cli.js +0 -52
- package/node_modules/winston-compat/node_modules/logform/colorize.js +0 -118
- package/node_modules/winston-compat/node_modules/logform/combine.js +0 -66
- package/node_modules/winston-compat/node_modules/logform/dist/align.js +0 -14
- package/node_modules/winston-compat/node_modules/logform/dist/browser.js +0 -37
- package/node_modules/winston-compat/node_modules/logform/dist/cli.js +0 -75
- package/node_modules/winston-compat/node_modules/logform/dist/colorize.js +0 -147
- package/node_modules/winston-compat/node_modules/logform/dist/combine.js +0 -66
- package/node_modules/winston-compat/node_modules/logform/dist/format.js +0 -69
- package/node_modules/winston-compat/node_modules/logform/dist/index.js +0 -54
- package/node_modules/winston-compat/node_modules/logform/dist/json.js +0 -27
- package/node_modules/winston-compat/node_modules/logform/dist/label.js +0 -19
- package/node_modules/winston-compat/node_modules/logform/dist/levels.js +0 -15
- package/node_modules/winston-compat/node_modules/logform/dist/logstash.js +0 -32
- package/node_modules/winston-compat/node_modules/logform/dist/metadata.js +0 -63
- package/node_modules/winston-compat/node_modules/logform/dist/ms.js +0 -18
- package/node_modules/winston-compat/node_modules/logform/dist/pad-levels.js +0 -118
- package/node_modules/winston-compat/node_modules/logform/dist/pretty-print.js +0 -20
- package/node_modules/winston-compat/node_modules/logform/dist/printf.js +0 -40
- package/node_modules/winston-compat/node_modules/logform/dist/simple.js +0 -36
- package/node_modules/winston-compat/node_modules/logform/dist/splat.js +0 -147
- package/node_modules/winston-compat/node_modules/logform/dist/timestamp.js +0 -28
- package/node_modules/winston-compat/node_modules/logform/dist/uncolorize.js +0 -31
- package/node_modules/winston-compat/node_modules/logform/examples/combine.js +0 -14
- package/node_modules/winston-compat/node_modules/logform/examples/filter.js +0 -30
- package/node_modules/winston-compat/node_modules/logform/examples/invalid.js +0 -6
- package/node_modules/winston-compat/node_modules/logform/examples/metadata.js +0 -78
- package/node_modules/winston-compat/node_modules/logform/examples/padLevels.js +0 -39
- package/node_modules/winston-compat/node_modules/logform/examples/volume.js +0 -25
- package/node_modules/winston-compat/node_modules/logform/format.js +0 -52
- package/node_modules/winston-compat/node_modules/logform/index.d.ts +0 -53
- package/node_modules/winston-compat/node_modules/logform/index.js +0 -52
- package/node_modules/winston-compat/node_modules/logform/json.js +0 -26
- package/node_modules/winston-compat/node_modules/logform/label.js +0 -19
- package/node_modules/winston-compat/node_modules/logform/levels.js +0 -12
- package/node_modules/winston-compat/node_modules/logform/logstash.js +0 -29
- package/node_modules/winston-compat/node_modules/logform/metadata.js +0 -61
- package/node_modules/winston-compat/node_modules/logform/ms.js +0 -18
- package/node_modules/winston-compat/node_modules/logform/package.json +0 -51
- package/node_modules/winston-compat/node_modules/logform/pad-levels.js +0 -83
- package/node_modules/winston-compat/node_modules/logform/pretty-print.js +0 -16
- package/node_modules/winston-compat/node_modules/logform/printf.js +0 -26
- package/node_modules/winston-compat/node_modules/logform/simple.js +0 -33
- package/node_modules/winston-compat/node_modules/logform/splat.js +0 -125
- package/node_modules/winston-compat/node_modules/logform/timestamp.js +0 -30
- package/node_modules/winston-compat/node_modules/logform/tsconfig.json +0 -22
- package/node_modules/winston-compat/node_modules/logform/uncolorize.js +0 -27
- package/node_modules/winston-compat/package.json +0 -46
- package/node_modules/winston-compat/test/clone.test.js +0 -25
- package/node_modules/winston-compat/test/helpers.js +0 -256
- package/node_modules/winston-compat/test/timestamp.test.js +0 -14
- package/node_modules/winston-compat/test/transports/transport.js +0 -205
- package/node_modules/winston-compat/test/winston-compat.test.js +0 -18
- package/node_modules/winston-daily-rotate-file/.eslintrc.js +0 -11
- package/node_modules/winston-daily-rotate-file/.node-version +0 -1
- package/node_modules/winston-daily-rotate-file/.travis.yml +0 -15
- package/node_modules/winston-daily-rotate-file/LICENSE +0 -22
- package/node_modules/winston-daily-rotate-file/README.md +0 -67
- package/node_modules/winston-daily-rotate-file/daily-rotate-file.js +0 -292
- package/node_modules/winston-daily-rotate-file/index.d.ts +0 -73
- package/node_modules/winston-daily-rotate-file/index.js +0 -7
- package/node_modules/winston-daily-rotate-file/node_modules/semver/CHANGELOG.md +0 -70
- package/node_modules/winston-daily-rotate-file/node_modules/semver/LICENSE +0 -15
- package/node_modules/winston-daily-rotate-file/node_modules/semver/README.md +0 -443
- package/node_modules/winston-daily-rotate-file/node_modules/semver/bin/semver.js +0 -174
- package/node_modules/winston-daily-rotate-file/node_modules/semver/package.json +0 -32
- package/node_modules/winston-daily-rotate-file/node_modules/semver/range.bnf +0 -16
- package/node_modules/winston-daily-rotate-file/node_modules/semver/semver.js +0 -1596
- package/node_modules/winston-daily-rotate-file/package.json +0 -54
- package/node_modules/winston-daily-rotate-file/test/memory-stream.js +0 -38
- package/node_modules/winston-daily-rotate-file/test/random-string.js +0 -31
- package/node_modules/winston-daily-rotate-file/test/transport-tests.js +0 -250
- package/node_modules/winston-transport/.babelrc +0 -3
- package/node_modules/winston-transport/.eslintrc +0 -7
- package/node_modules/winston-transport/.gitattributes +0 -1
- package/node_modules/winston-transport/.nyc_output/1c69f3e4-4c25-457d-9df5-dfa761729528.json +0 -1
- package/node_modules/winston-transport/.nyc_output/processinfo/1c69f3e4-4c25-457d-9df5-dfa761729528.json +0 -1
- package/node_modules/winston-transport/.nyc_output/processinfo/index.json +0 -1
- package/node_modules/winston-transport/.travis.yml +0 -17
- package/node_modules/winston-transport/CHANGELOG.md +0 -115
- package/node_modules/winston-transport/LICENSE +0 -22
- package/node_modules/winston-transport/README.md +0 -50
- package/node_modules/winston-transport/dist/index.js +0 -215
- package/node_modules/winston-transport/dist/legacy.js +0 -116
- package/node_modules/winston-transport/index.d.ts +0 -37
- package/node_modules/winston-transport/index.js +0 -215
- package/node_modules/winston-transport/legacy.js +0 -119
- package/node_modules/winston-transport/package.json +0 -54
- package/node_modules/winston-transport/tsconfig.json +0 -22
- package/perf-logs.js +0 -155
- 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])
|