game_dig 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +0 -4
- data/CHANGELOG.md +13 -0
- data/README.md +88 -28
- data/Rakefile +3 -3
- data/cli/pry_nodo.rb +5 -0
- data/game_dig.gemspec +21 -14
- data/lib/custom_errors/cli_not_found.rb +4 -0
- data/lib/custom_errors/error.rb +4 -0
- data/lib/game_dig/helper.rb +51 -0
- data/lib/game_dig/node/gamedig-example.js +17 -0
- data/lib/game_dig/node/node_modules/.bin/fxparser +1 -0
- data/lib/game_dig/node/node_modules/.bin/gamedig +1 -0
- data/lib/game_dig/node/node_modules/.bin/seek-bunzip +1 -0
- data/lib/game_dig/node/node_modules/.bin/seek-table +1 -0
- data/lib/game_dig/node/node_modules/.yarn-integrity +73 -0
- data/lib/game_dig/node/node_modules/@sindresorhus/is/dist/index.d.ts +246 -0
- data/lib/game_dig/node/node_modules/@sindresorhus/is/dist/index.js +454 -0
- data/lib/game_dig/node/node_modules/@sindresorhus/is/dist/types.d.ts +32 -0
- data/lib/game_dig/node/node_modules/@sindresorhus/is/dist/types.js +2 -0
- data/lib/game_dig/node/node_modules/@sindresorhus/is/license +9 -0
- data/lib/game_dig/node/node_modules/@sindresorhus/is/package.json +76 -0
- data/lib/game_dig/node/node_modules/@sindresorhus/is/readme.md +698 -0
- data/lib/game_dig/node/node_modules/@szmarczak/http-timer/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/@szmarczak/http-timer/README.md +93 -0
- data/lib/game_dig/node/node_modules/@szmarczak/http-timer/dist/source/index.d.ts +32 -0
- data/lib/game_dig/node/node_modules/@szmarczak/http-timer/dist/source/index.js +106 -0
- data/lib/game_dig/node/node_modules/@szmarczak/http-timer/package.json +89 -0
- data/lib/game_dig/node/node_modules/@types/http-cache-semantics/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/@types/http-cache-semantics/README.md +15 -0
- data/lib/game_dig/node/node_modules/@types/http-cache-semantics/index.d.ts +165 -0
- data/lib/game_dig/node/node_modules/@types/http-cache-semantics/package.json +25 -0
- data/lib/game_dig/node/node_modules/any-promise/.jshintrc +4 -0
- data/lib/game_dig/node/node_modules/any-promise/.npmignore +7 -0
- data/lib/game_dig/node/node_modules/any-promise/LICENSE +19 -0
- data/lib/game_dig/node/node_modules/any-promise/README.md +161 -0
- data/lib/game_dig/node/node_modules/any-promise/implementation.d.ts +3 -0
- data/lib/game_dig/node/node_modules/any-promise/implementation.js +1 -0
- data/lib/game_dig/node/node_modules/any-promise/index.d.ts +73 -0
- data/lib/game_dig/node/node_modules/any-promise/index.js +1 -0
- data/lib/game_dig/node/node_modules/any-promise/loader.js +78 -0
- data/lib/game_dig/node/node_modules/any-promise/optional.js +6 -0
- data/lib/game_dig/node/node_modules/any-promise/package.json +45 -0
- data/lib/game_dig/node/node_modules/any-promise/register/bluebird.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/bluebird.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register/es6-promise.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/es6-promise.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register/lie.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/lie.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register/native-promise-only.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/native-promise-only.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register/pinkie.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/pinkie.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register/promise.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/promise.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register/q.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/q.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register/rsvp.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/rsvp.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register/vow.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/vow.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register/when.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/when.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register-shim.js +18 -0
- data/lib/game_dig/node/node_modules/any-promise/register.d.ts +17 -0
- data/lib/game_dig/node/node_modules/any-promise/register.js +94 -0
- data/lib/game_dig/node/node_modules/barse/.npmignore +2 -0
- data/lib/game_dig/node/node_modules/barse/.travis.yml +4 -0
- data/lib/game_dig/node/node_modules/barse/README.md +138 -0
- data/lib/game_dig/node/node_modules/barse/example/complete.js +34 -0
- data/lib/game_dig/node/node_modules/barse/example/next.js +21 -0
- data/lib/game_dig/node/node_modules/barse/index.js +282 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/.npmignore +5 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/LICENSE +18 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/README.md +15 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/duplex.js +1 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/lib/_stream_duplex.js +89 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/lib/_stream_passthrough.js +46 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/lib/_stream_readable.js +982 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/lib/_stream_transform.js +210 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/lib/_stream_writable.js +386 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/package.json +32 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/passthrough.js +1 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/readable.js +11 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/transform.js +1 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/writable.js +1 -0
- data/lib/game_dig/node/node_modules/barse/package.json +48 -0
- data/lib/game_dig/node/node_modules/barse/test/integration.js +37 -0
- data/lib/game_dig/node/node_modules/barse/test/loop.js +36 -0
- data/lib/game_dig/node/node_modules/barse/test/next.js +34 -0
- data/lib/game_dig/node/node_modules/barse/test/scope.js +18 -0
- data/lib/game_dig/node/node_modules/barse/test/string.js +33 -0
- data/lib/game_dig/node/node_modules/barse/test/vars.js +20 -0
- data/lib/game_dig/node/node_modules/cacheable-lookup/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/cacheable-lookup/README.md +245 -0
- data/lib/game_dig/node/node_modules/cacheable-lookup/index.d.ts +144 -0
- data/lib/game_dig/node/node_modules/cacheable-lookup/package.json +61 -0
- data/lib/game_dig/node/node_modules/cacheable-lookup/source/index.js +452 -0
- data/lib/game_dig/node/node_modules/cacheable-request/README.md +335 -0
- data/lib/game_dig/node/node_modules/cacheable-request/dist/index.d.ts +17 -0
- data/lib/game_dig/node/node_modules/cacheable-request/dist/index.d.ts.map +1 -0
- data/lib/game_dig/node/node_modules/cacheable-request/dist/index.js +275 -0
- data/lib/game_dig/node/node_modules/cacheable-request/dist/index.js.map +1 -0
- data/lib/game_dig/node/node_modules/cacheable-request/dist/types.d.ts +106 -0
- data/lib/game_dig/node/node_modules/cacheable-request/dist/types.d.ts.map +1 -0
- data/lib/game_dig/node/node_modules/cacheable-request/dist/types.js +19 -0
- data/lib/game_dig/node/node_modules/cacheable-request/dist/types.js.map +1 -0
- data/lib/game_dig/node/node_modules/cacheable-request/node_modules/mimic-response/index.d.ts +29 -0
- data/lib/game_dig/node/node_modules/cacheable-request/node_modules/mimic-response/index.js +75 -0
- data/lib/game_dig/node/node_modules/cacheable-request/node_modules/mimic-response/license +9 -0
- data/lib/game_dig/node/node_modules/cacheable-request/node_modules/mimic-response/package.json +44 -0
- data/lib/game_dig/node/node_modules/cacheable-request/node_modules/mimic-response/readme.md +78 -0
- data/lib/game_dig/node/node_modules/cacheable-request/package.json +121 -0
- data/lib/game_dig/node/node_modules/commander/CHANGELOG.md +361 -0
- data/lib/game_dig/node/node_modules/commander/LICENSE +22 -0
- data/lib/game_dig/node/node_modules/commander/Readme.md +791 -0
- data/lib/game_dig/node/node_modules/commander/index.js +1881 -0
- data/lib/game_dig/node/node_modules/commander/package.json +51 -0
- data/lib/game_dig/node/node_modules/commander/typings/index.d.ts +410 -0
- data/lib/game_dig/node/node_modules/core-util-is/LICENSE +19 -0
- data/lib/game_dig/node/node_modules/core-util-is/README.md +3 -0
- data/lib/game_dig/node/node_modules/core-util-is/lib/util.js +107 -0
- data/lib/game_dig/node/node_modules/core-util-is/package.json +38 -0
- data/lib/game_dig/node/node_modules/decompress-response/index.d.ts +22 -0
- data/lib/game_dig/node/node_modules/decompress-response/index.js +58 -0
- data/lib/game_dig/node/node_modules/decompress-response/license +9 -0
- data/lib/game_dig/node/node_modules/decompress-response/package.json +56 -0
- data/lib/game_dig/node/node_modules/decompress-response/readme.md +48 -0
- data/lib/game_dig/node/node_modules/defer-to-connect/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/defer-to-connect/README.md +38 -0
- data/lib/game_dig/node/node_modules/defer-to-connect/dist/source/index.d.ts +10 -0
- data/lib/game_dig/node/node_modules/defer-to-connect/dist/source/index.js +47 -0
- data/lib/game_dig/node/node_modules/defer-to-connect/package.json +71 -0
- data/lib/game_dig/node/node_modules/emitter-component/History.md +35 -0
- data/lib/game_dig/node/node_modules/emitter-component/Makefile +7 -0
- data/lib/game_dig/node/node_modules/emitter-component/Readme.md +70 -0
- data/lib/game_dig/node/node_modules/emitter-component/bower.json +21 -0
- data/lib/game_dig/node/node_modules/emitter-component/component.json +9 -0
- data/lib/game_dig/node/node_modules/emitter-component/index.js +164 -0
- data/lib/game_dig/node/node_modules/emitter-component/package.json +19 -0
- data/lib/game_dig/node/node_modules/emitter-component/test/emitter.js +195 -0
- data/lib/game_dig/node/node_modules/event-to-promise/LICENSE +14 -0
- data/lib/game_dig/node/node_modules/event-to-promise/README.md +180 -0
- data/lib/game_dig/node/node_modules/event-to-promise/index.js +106 -0
- data/lib/game_dig/node/node_modules/event-to-promise/package.json +35 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/CHANGELOG.md +671 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/README.md +223 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxp.d.cts +458 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxvalidator.min.js +2 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/package.json +90 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/cli/cli.js +97 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/cli/man.js +17 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/cli/read.js +43 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/fxp.d.ts +445 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/fxp.js +14 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/ignoreAttributes.js +18 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/util.js +68 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/CharsSymbol.js +16 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +104 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +61 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +69 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +103 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +100 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +154 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +94 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/Report.js +0 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/TagPath.js +81 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/TagPathMatcher.js +13 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/XMLParser.js +83 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/Xml2JsParser.js +235 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/XmlPartReader.js +210 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/XmlSpecialTagsReader.js +111 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/inputSource/BufferSource.js +116 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/inputSource/StringSource.js +121 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +105 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParser.js +22 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParserExt.js +19 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/valueParsers/currency.js +38 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/valueParsers/join.js +13 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/valueParsers/number.js +14 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/valueParsers/trim.js +6 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/validator.js +425 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +285 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js +134 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/xmlbuilder/prettifyJs2Xml.js +0 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +369 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +46 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +606 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +71 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/xmlparser/node2json.js +119 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +40 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/FileLike.d.ts +23 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/FormDataEncoder.d.ts +169 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/FormDataLike.d.ts +40 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/index.d.ts +5 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/Headers.d.ts +8 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/createBoundary.d.ts +12 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/escapeName.d.ts +10 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/getStreamIterator.d.ts +6 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/isFile.d.ts +34 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/isFormData.d.ts +7 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/isFunction.d.ts +6 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/isPlainObject.d.ts +1 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/normalizeValue.d.ts +10 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/proxyHeaders.d.ts +2 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/FileLike.js +1 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/FormDataEncoder.js +134 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/FormDataLike.js +1 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/index.js +5 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/Headers.js +1 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/createBoundary.js +9 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/escapeName.js +4 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/getStreamIterator.js +21 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/isFile.js +8 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/isFormData.js +8 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/isFunction.js +1 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/isPlainObject.js +12 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/normalizeValue.js +8 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/proxyHeaders.js +14 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/license +21 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/package.json +70 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/readme.md +368 -0
- data/lib/game_dig/node/node_modules/gamedig/GAMES_LIST.md +563 -0
- data/lib/game_dig/node/node_modules/gamedig/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/gamedig/README.md +155 -0
- data/lib/game_dig/node/node_modules/gamedig/bin/gamedig.js +64 -0
- data/lib/game_dig/node/node_modules/gamedig/dist/index.cjs +18075 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/DnsResolver.js +80 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/GlobalUdpSocket.js +69 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/HexUtil.js +20 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/Logger.js +45 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/Promises.js +18 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/ProtocolResolver.js +7 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/QueryRunner.js +122 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/Results.js +36 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/game-resolver.js +27 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/gamedig.js +23 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/games.js +3458 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/index.js +5 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/reader.js +172 -0
- data/lib/game_dig/node/node_modules/gamedig/node_modules/.bin/fxparser +1 -0
- data/lib/game_dig/node/node_modules/gamedig/node_modules/.bin/seek-bunzip +1 -0
- data/lib/game_dig/node/node_modules/gamedig/node_modules/.bin/seek-table +1 -0
- data/lib/game_dig/node/node_modules/gamedig/package.json +80 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/altvmp.js +63 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/armagetron.js +65 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/asa.js +18 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/ase.js +45 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/assettocorsa.js +41 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/battlefield.js +167 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/beammp.js +46 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/beammpmaster.js +17 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/brokeprotocol.js +13 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/brokeprotocolmaster.js +418 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/buildandshoot.js +42 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/core.js +369 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/cs2d.js +65 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/dayz.js +196 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/discord.js +29 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/doom3.js +149 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/eco.js +22 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/eldewrito.js +22 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/epic.js +153 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/factorio.js +24 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/farmingsimulator.js +69 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/ffow.js +38 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/fivem.js +35 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/gamespy1.js +182 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/gamespy2.js +142 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/gamespy3.js +198 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/geneshift.js +46 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/goldsrc.js +8 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/gtasao.js +8 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/hawakening.js +13 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/hawakeningmaster.js +718 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/hexen2.js +14 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/index.js +85 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/jc2mp.js +18 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/kspdmp.js +28 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/mafia2mp.js +42 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/mafia2online.js +9 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/minecraft.js +107 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/minecraftbedrock.js +73 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/minecraftvanilla.js +86 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/minetest.js +39 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/mumble.js +39 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/mumbleping.js +25 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/nadeo.js +85 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/openttd.js +164 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/palworld.js +32 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/quake1.js +14 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/quake2.js +90 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/quake3.js +28 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/ragemp.js +49 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/renegadex.js +232 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/renegadexmaster.js +21 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/renown.js +20 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/rfactor.js +69 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/samp.js +105 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/satisfactory.js +106 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/savage2.js +25 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/scpsl.js +54 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/sdtd.js +109 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/soldat.js +45 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/squad.js +20 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/starmade.js +67 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/starsiege.js +10 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/teamspeak2.js +72 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/teamspeak3.js +70 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/terraria.js +27 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/theisleevrima.js +19 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/toxikk.js +122 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/tribes1.js +153 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/tribes1master.js +80 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/unreal2.js +151 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/ut3.js +45 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/valve.js +472 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/vcmp.js +10 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/ventrilo.js +238 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/vintagestory.js +24 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/vintagestorymaster.js +17 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/warsow.js +13 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/xonotic.js +16 -0
- data/lib/game_dig/node/node_modules/gbxremote/.editorconfig +15 -0
- data/lib/game_dig/node/node_modules/gbxremote/.npmignore +5 -0
- data/lib/game_dig/node/node_modules/gbxremote/LICENSE +23 -0
- data/lib/game_dig/node/node_modules/gbxremote/README.md +196 -0
- data/lib/game_dig/node/node_modules/gbxremote/lib/client.js +214 -0
- data/lib/game_dig/node/node_modules/gbxremote/lib/gbxremote.js +18 -0
- data/lib/game_dig/node/node_modules/gbxremote/package.json +55 -0
- data/lib/game_dig/node/node_modules/get-stream/buffer-stream.js +52 -0
- data/lib/game_dig/node/node_modules/get-stream/index.d.ts +105 -0
- data/lib/game_dig/node/node_modules/get-stream/index.js +61 -0
- data/lib/game_dig/node/node_modules/get-stream/license +9 -0
- data/lib/game_dig/node/node_modules/get-stream/package.json +47 -0
- data/lib/game_dig/node/node_modules/get-stream/readme.md +124 -0
- data/lib/game_dig/node/node_modules/got/dist/source/as-promise/index.d.ts +3 -0
- data/lib/game_dig/node/node_modules/got/dist/source/as-promise/index.js +158 -0
- data/lib/game_dig/node/node_modules/got/dist/source/as-promise/types.d.ts +38 -0
- data/lib/game_dig/node/node_modules/got/dist/source/as-promise/types.js +17 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/calculate-retry-delay.d.ts +4 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/calculate-retry-delay.js +29 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/errors.d.ts +90 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/errors.js +178 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/index.d.ts +190 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/index.js +1126 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/options.d.ts +1253 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/options.js +1653 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/parse-link-header.d.ts +4 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/parse-link-header.js +33 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/response.d.ts +109 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/response.js +39 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/timed-out.d.ts +30 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/timed-out.js +138 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/get-body-size.d.ts +3 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/get-body-size.js +22 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/is-client-request.d.ts +5 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/is-client-request.js +4 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/is-form-data.d.ts +8 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/is-form-data.js +4 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/is-unix-socket-url.d.ts +2 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/is-unix-socket-url.js +4 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/options-to-url.d.ts +13 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/options-to-url.js +48 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/proxy-events.d.ts +3 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/proxy-events.js +15 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/unhandle.d.ts +11 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/unhandle.js +20 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/url-to-options.d.ts +15 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/url-to-options.js +22 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/weakable-map.d.ts +8 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/weakable-map.js +38 -0
- data/lib/game_dig/node/node_modules/got/dist/source/create.d.ts +3 -0
- data/lib/game_dig/node/node_modules/got/dist/source/create.js +187 -0
- data/lib/game_dig/node/node_modules/got/dist/source/index.d.ts +15 -0
- data/lib/game_dig/node/node_modules/got/dist/source/index.js +20 -0
- data/lib/game_dig/node/node_modules/got/dist/source/types.d.ts +262 -0
- data/lib/game_dig/node/node_modules/got/dist/source/types.js +1 -0
- data/lib/game_dig/node/node_modules/got/license +9 -0
- data/lib/game_dig/node/node_modules/got/package.json +155 -0
- data/lib/game_dig/node/node_modules/got/readme.md +527 -0
- data/lib/game_dig/node/node_modules/http-cache-semantics/LICENSE +9 -0
- data/lib/game_dig/node/node_modules/http-cache-semantics/README.md +268 -0
- data/lib/game_dig/node/node_modules/http-cache-semantics/index.js +928 -0
- data/lib/game_dig/node/node_modules/http-cache-semantics/package.json +22 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/README.md +459 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/index.d.ts +141 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/package.json +81 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/agent.js +796 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/auto.js +225 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/client-request.js +563 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/incoming-message.js +73 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/index.js +50 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/proxies/get-auth-headers.js +17 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/proxies/h1-over-h2.js +90 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/proxies/h2-over-h1.js +48 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/proxies/h2-over-h2.js +32 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/proxies/h2-over-hx.js +40 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/proxies/initialize.js +21 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/proxies/unexpected-status-code-error.js +11 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/calculate-server-name.js +29 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/check-type.js +20 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/delay-async-destroy.js +33 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/errors.js +51 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js +13 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/js-stream-socket.js +8 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/proxy-events.js +7 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/proxy-socket-handler.js +102 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/validate-header-name.js +11 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/validate-header-value.js +17 -0
- data/lib/game_dig/node/node_modules/iconv-lite/Changelog.md +236 -0
- data/lib/game_dig/node/node_modules/iconv-lite/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/iconv-lite/README.md +138 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/dbcs-codec.js +532 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/dbcs-data.js +185 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/index.js +23 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/internal.js +218 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/sbcs-codec.js +75 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/sbcs-data.js +178 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/utf16.js +187 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/utf32.js +307 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/utf7.js +283 -0
- data/lib/game_dig/node/node_modules/iconv-lite/lib/bom-handling.js +48 -0
- data/lib/game_dig/node/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
- data/lib/game_dig/node/node_modules/iconv-lite/lib/index.d.ts +41 -0
- data/lib/game_dig/node/node_modules/iconv-lite/lib/index.js +183 -0
- data/lib/game_dig/node/node_modules/iconv-lite/lib/streams.js +105 -0
- data/lib/game_dig/node/node_modules/iconv-lite/package.json +59 -0
- data/lib/game_dig/node/node_modules/inherits/LICENSE +16 -0
- data/lib/game_dig/node/node_modules/inherits/README.md +42 -0
- data/lib/game_dig/node/node_modules/inherits/inherits.js +9 -0
- data/lib/game_dig/node/node_modules/inherits/inherits_browser.js +27 -0
- data/lib/game_dig/node/node_modules/inherits/package.json +29 -0
- data/lib/game_dig/node/node_modules/isarray/README.md +54 -0
- data/lib/game_dig/node/node_modules/isarray/build/build.js +209 -0
- data/lib/game_dig/node/node_modules/isarray/component.json +19 -0
- data/lib/game_dig/node/node_modules/isarray/index.js +3 -0
- data/lib/game_dig/node/node_modules/isarray/package.json +25 -0
- data/lib/game_dig/node/node_modules/json-buffer/.travis.yml +3 -0
- data/lib/game_dig/node/node_modules/json-buffer/LICENSE +22 -0
- data/lib/game_dig/node/node_modules/json-buffer/README.md +24 -0
- data/lib/game_dig/node/node_modules/json-buffer/index.js +58 -0
- data/lib/game_dig/node/node_modules/json-buffer/package.json +34 -0
- data/lib/game_dig/node/node_modules/json-buffer/test/index.js +63 -0
- data/lib/game_dig/node/node_modules/keyv/README.md +429 -0
- data/lib/game_dig/node/node_modules/keyv/package.json +57 -0
- data/lib/game_dig/node/node_modules/keyv/src/index.d.ts +112 -0
- data/lib/game_dig/node/node_modules/keyv/src/index.js +259 -0
- data/lib/game_dig/node/node_modules/long/LICENSE +202 -0
- data/lib/game_dig/node/node_modules/long/README.md +286 -0
- data/lib/game_dig/node/node_modules/long/index.d.ts +2 -0
- data/lib/game_dig/node/node_modules/long/index.js +1581 -0
- data/lib/game_dig/node/node_modules/long/package.json +58 -0
- data/lib/game_dig/node/node_modules/long/types.d.ts +474 -0
- data/lib/game_dig/node/node_modules/long/umd/index.d.ts +3 -0
- data/lib/game_dig/node/node_modules/long/umd/index.js +1622 -0
- data/lib/game_dig/node/node_modules/long/umd/package.json +3 -0
- data/lib/game_dig/node/node_modules/long/umd/types.d.ts +474 -0
- data/lib/game_dig/node/node_modules/lowercase-keys/index.d.ts +14 -0
- data/lib/game_dig/node/node_modules/lowercase-keys/index.js +3 -0
- data/lib/game_dig/node/node_modules/lowercase-keys/license +9 -0
- data/lib/game_dig/node/node_modules/lowercase-keys/package.json +41 -0
- data/lib/game_dig/node/node_modules/lowercase-keys/readme.md +32 -0
- data/lib/game_dig/node/node_modules/mimic-response/index.d.ts +17 -0
- data/lib/game_dig/node/node_modules/mimic-response/index.js +77 -0
- data/lib/game_dig/node/node_modules/mimic-response/license +9 -0
- data/lib/game_dig/node/node_modules/mimic-response/package.json +42 -0
- data/lib/game_dig/node/node_modules/mimic-response/readme.md +78 -0
- data/lib/game_dig/node/node_modules/minimist/.eslintrc +29 -0
- data/lib/game_dig/node/node_modules/minimist/.github/FUNDING.yml +12 -0
- data/lib/game_dig/node/node_modules/minimist/.nycrc +14 -0
- data/lib/game_dig/node/node_modules/minimist/CHANGELOG.md +298 -0
- data/lib/game_dig/node/node_modules/minimist/LICENSE +18 -0
- data/lib/game_dig/node/node_modules/minimist/README.md +121 -0
- data/lib/game_dig/node/node_modules/minimist/example/parse.js +4 -0
- data/lib/game_dig/node/node_modules/minimist/index.js +263 -0
- data/lib/game_dig/node/node_modules/minimist/package.json +75 -0
- data/lib/game_dig/node/node_modules/minimist/test/all_bool.js +34 -0
- data/lib/game_dig/node/node_modules/minimist/test/bool.js +177 -0
- data/lib/game_dig/node/node_modules/minimist/test/dash.js +43 -0
- data/lib/game_dig/node/node_modules/minimist/test/default_bool.js +37 -0
- data/lib/game_dig/node/node_modules/minimist/test/dotted.js +24 -0
- data/lib/game_dig/node/node_modules/minimist/test/kv_short.js +32 -0
- data/lib/game_dig/node/node_modules/minimist/test/long.js +33 -0
- data/lib/game_dig/node/node_modules/minimist/test/num.js +38 -0
- data/lib/game_dig/node/node_modules/minimist/test/parse.js +209 -0
- data/lib/game_dig/node/node_modules/minimist/test/parse_modified.js +11 -0
- data/lib/game_dig/node/node_modules/minimist/test/proto.js +64 -0
- data/lib/game_dig/node/node_modules/minimist/test/short.js +69 -0
- data/lib/game_dig/node/node_modules/minimist/test/stop_early.js +17 -0
- data/lib/game_dig/node/node_modules/minimist/test/unknown.js +104 -0
- data/lib/game_dig/node/node_modules/minimist/test/whitespace.js +10 -0
- data/lib/game_dig/node/node_modules/net/LICENSE +19 -0
- data/lib/game_dig/node/node_modules/net/README.md +0 -0
- data/lib/game_dig/node/node_modules/net/index.js +28 -0
- data/lib/game_dig/node/node_modules/net/package.json +17 -0
- data/lib/game_dig/node/node_modules/net/test.js +6 -0
- data/lib/game_dig/node/node_modules/normalize-url/index.d.ts +342 -0
- data/lib/game_dig/node/node_modules/normalize-url/index.js +308 -0
- data/lib/game_dig/node/node_modules/normalize-url/license +9 -0
- data/lib/game_dig/node/node_modules/normalize-url/package.json +57 -0
- data/lib/game_dig/node/node_modules/normalize-url/readme.md +347 -0
- data/lib/game_dig/node/node_modules/p-cancelable/index.d.ts +168 -0
- data/lib/game_dig/node/node_modules/p-cancelable/index.js +110 -0
- data/lib/game_dig/node/node_modules/p-cancelable/license +9 -0
- data/lib/game_dig/node/node_modules/p-cancelable/package.json +50 -0
- data/lib/game_dig/node/node_modules/p-cancelable/readme.md +152 -0
- data/lib/game_dig/node/node_modules/process-nextick-args/index.js +45 -0
- data/lib/game_dig/node/node_modules/process-nextick-args/license.md +19 -0
- data/lib/game_dig/node/node_modules/process-nextick-args/package.json +25 -0
- data/lib/game_dig/node/node_modules/process-nextick-args/readme.md +18 -0
- data/lib/game_dig/node/node_modules/quick-lru/index.d.ts +97 -0
- data/lib/game_dig/node/node_modules/quick-lru/index.js +123 -0
- data/lib/game_dig/node/node_modules/quick-lru/license +9 -0
- data/lib/game_dig/node/node_modules/quick-lru/package.json +43 -0
- data/lib/game_dig/node/node_modules/quick-lru/readme.md +111 -0
- data/lib/game_dig/node/node_modules/readable-stream/.travis.yml +34 -0
- data/lib/game_dig/node/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- data/lib/game_dig/node/node_modules/readable-stream/GOVERNANCE.md +136 -0
- data/lib/game_dig/node/node_modules/readable-stream/LICENSE +47 -0
- data/lib/game_dig/node/node_modules/readable-stream/README.md +58 -0
- data/lib/game_dig/node/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
- data/lib/game_dig/node/node_modules/readable-stream/duplex-browser.js +1 -0
- data/lib/game_dig/node/node_modules/readable-stream/duplex.js +1 -0
- data/lib/game_dig/node/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
- data/lib/game_dig/node/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
- data/lib/game_dig/node/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
- data/lib/game_dig/node/node_modules/readable-stream/lib/_stream_transform.js +214 -0
- data/lib/game_dig/node/node_modules/readable-stream/lib/_stream_writable.js +685 -0
- data/lib/game_dig/node/node_modules/readable-stream/lib/internal/streams/BufferList.js +78 -0
- data/lib/game_dig/node/node_modules/readable-stream/lib/internal/streams/destroy.js +84 -0
- data/lib/game_dig/node/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- data/lib/game_dig/node/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/isarray/.npmignore +1 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/isarray/.travis.yml +4 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/isarray/Makefile +6 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/isarray/README.md +60 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/isarray/component.json +19 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/isarray/index.js +5 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/isarray/package.json +45 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/isarray/test.js +20 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/string_decoder/.travis.yml +50 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/string_decoder/LICENSE +48 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/string_decoder/README.md +47 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/string_decoder/lib/string_decoder.js +296 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/string_decoder/package.json +31 -0
- data/lib/game_dig/node/node_modules/readable-stream/package.json +52 -0
- data/lib/game_dig/node/node_modules/readable-stream/passthrough.js +1 -0
- data/lib/game_dig/node/node_modules/readable-stream/readable-browser.js +7 -0
- data/lib/game_dig/node/node_modules/readable-stream/readable.js +19 -0
- data/lib/game_dig/node/node_modules/readable-stream/transform.js +1 -0
- data/lib/game_dig/node/node_modules/readable-stream/writable-browser.js +1 -0
- data/lib/game_dig/node/node_modules/readable-stream/writable.js +8 -0
- data/lib/game_dig/node/node_modules/resolve-alpn/LICENSE +22 -0
- data/lib/game_dig/node/node_modules/resolve-alpn/README.md +60 -0
- data/lib/game_dig/node/node_modules/resolve-alpn/index.js +43 -0
- data/lib/game_dig/node/node_modules/resolve-alpn/package.json +34 -0
- data/lib/game_dig/node/node_modules/responselike/LICENSE +19 -0
- data/lib/game_dig/node/node_modules/responselike/README.md +77 -0
- data/lib/game_dig/node/node_modules/responselike/index.d.ts +86 -0
- data/lib/game_dig/node/node_modules/responselike/index.js +39 -0
- data/lib/game_dig/node/node_modules/responselike/license +10 -0
- data/lib/game_dig/node/node_modules/responselike/package.json +39 -0
- data/lib/game_dig/node/node_modules/responselike/readme.md +75 -0
- data/lib/game_dig/node/node_modules/safe-buffer/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/safe-buffer/README.md +584 -0
- data/lib/game_dig/node/node_modules/safe-buffer/index.d.ts +187 -0
- data/lib/game_dig/node/node_modules/safe-buffer/index.js +62 -0
- data/lib/game_dig/node/node_modules/safe-buffer/package.json +37 -0
- data/lib/game_dig/node/node_modules/safer-buffer/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/safer-buffer/Porting-Buffer.md +268 -0
- data/lib/game_dig/node/node_modules/safer-buffer/Readme.md +156 -0
- data/lib/game_dig/node/node_modules/safer-buffer/dangerous.js +58 -0
- data/lib/game_dig/node/node_modules/safer-buffer/package.json +34 -0
- data/lib/game_dig/node/node_modules/safer-buffer/safer.js +77 -0
- data/lib/game_dig/node/node_modules/safer-buffer/tests.js +406 -0
- data/lib/game_dig/node/node_modules/sax/LICENSE +41 -0
- data/lib/game_dig/node/node_modules/sax/README.md +225 -0
- data/lib/game_dig/node/node_modules/sax/lib/sax.js +1565 -0
- data/lib/game_dig/node/node_modules/sax/package.json +25 -0
- data/lib/game_dig/node/node_modules/seek-bzip/LICENSE +26 -0
- data/lib/game_dig/node/node_modules/seek-bzip/README.md +185 -0
- data/lib/game_dig/node/node_modules/seek-bzip/bin/seek-bunzip +129 -0
- data/lib/game_dig/node/node_modules/seek-bzip/bin/seek-bzip-table +71 -0
- data/lib/game_dig/node/node_modules/seek-bzip/lib/bitreader.js +94 -0
- data/lib/game_dig/node/node_modules/seek-bzip/lib/crc32.js +104 -0
- data/lib/game_dig/node/node_modules/seek-bzip/lib/index.js +605 -0
- data/lib/game_dig/node/node_modules/seek-bzip/lib/stream.js +42 -0
- data/lib/game_dig/node/node_modules/seek-bzip/package.json +34 -0
- data/lib/game_dig/node/node_modules/stream/.npmignore +3 -0
- data/lib/game_dig/node/node_modules/stream/Makefile +11 -0
- data/lib/game_dig/node/node_modules/stream/README.md +59 -0
- data/lib/game_dig/node/node_modules/stream/component.json +19 -0
- data/lib/game_dig/node/node_modules/stream/index.js +115 -0
- data/lib/game_dig/node/node_modules/stream/package.json +25 -0
- data/lib/game_dig/node/node_modules/stream/test.html +173 -0
- data/lib/game_dig/node/node_modules/string-to-stream/LICENSE +20 -0
- data/lib/game_dig/node/node_modules/string-to-stream/README.md +34 -0
- data/lib/game_dig/node/node_modules/string-to-stream/index.js +23 -0
- data/lib/game_dig/node/node_modules/string-to-stream/package.json +53 -0
- data/lib/game_dig/node/node_modules/string_decoder/.npmignore +2 -0
- data/lib/game_dig/node/node_modules/string_decoder/LICENSE +20 -0
- data/lib/game_dig/node/node_modules/string_decoder/README.md +7 -0
- data/lib/game_dig/node/node_modules/string_decoder/index.js +221 -0
- data/lib/game_dig/node/node_modules/string_decoder/package.json +25 -0
- data/lib/game_dig/node/node_modules/strnum/.github/SECURITY.md +5 -0
- data/lib/game_dig/node/node_modules/strnum/.vscode/launch.json +25 -0
- data/lib/game_dig/node/node_modules/strnum/CHANGELOG.md +33 -0
- data/lib/game_dig/node/node_modules/strnum/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/strnum/README.md +97 -0
- data/lib/game_dig/node/node_modules/strnum/algo.stflow +84 -0
- data/lib/game_dig/node/node_modules/strnum/package.json +31 -0
- data/lib/game_dig/node/node_modules/strnum/strnum.js +129 -0
- data/lib/game_dig/node/node_modules/strnum/strnum.test.js +173 -0
- data/lib/game_dig/node/node_modules/strnum/test.js +9 -0
- data/lib/game_dig/node/node_modules/telnet-client/LICENSE +8 -0
- data/lib/game_dig/node/node_modules/telnet-client/README.md +363 -0
- data/lib/game_dig/node/node_modules/telnet-client/lib/index.d.ts +92 -0
- data/lib/game_dig/node/node_modules/telnet-client/lib/index.js +506 -0
- data/lib/game_dig/node/node_modules/telnet-client/lib/index.js.map +1 -0
- data/lib/game_dig/node/node_modules/telnet-client/lib/utils.d.ts +15 -0
- data/lib/game_dig/node/node_modules/telnet-client/lib/utils.js +34 -0
- data/lib/game_dig/node/node_modules/telnet-client/lib/utils.js.map +1 -0
- data/lib/game_dig/node/node_modules/telnet-client/package.json +103 -0
- data/lib/game_dig/node/node_modules/util-deprecate/History.md +16 -0
- data/lib/game_dig/node/node_modules/util-deprecate/LICENSE +24 -0
- data/lib/game_dig/node/node_modules/util-deprecate/README.md +53 -0
- data/lib/game_dig/node/node_modules/util-deprecate/browser.js +67 -0
- data/lib/game_dig/node/node_modules/util-deprecate/node.js +6 -0
- data/lib/game_dig/node/node_modules/util-deprecate/package.json +27 -0
- data/lib/game_dig/node/node_modules/varint/README.md +53 -0
- data/lib/game_dig/node/node_modules/varint/bench.js +57 -0
- data/lib/game_dig/node/node_modules/varint/decode.js +29 -0
- data/lib/game_dig/node/node_modules/varint/encode.js +30 -0
- data/lib/game_dig/node/node_modules/varint/index.js +5 -0
- data/lib/game_dig/node/node_modules/varint/length.js +25 -0
- data/lib/game_dig/node/node_modules/varint/package.json +24 -0
- data/lib/game_dig/node/node_modules/varint/test.js +156 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/.npmignore +5 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/CHANGELOG.md +395 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/README.md +85 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/Utility.js +139 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLAttribute.js +31 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLCData.js +32 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLComment.js +32 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLDTDAttList.js +50 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLDTDElement.js +35 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLDTDEntity.js +56 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLDTDNotation.js +37 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLDeclaration.js +40 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLDocType.js +107 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLDocument.js +48 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLDocumentCB.js +402 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLElement.js +111 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLNode.js +432 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js +35 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLRaw.js +32 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLStreamWriter.js +278 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLStringWriter.js +302 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLStringifier.js +192 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLText.js +32 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLWriterBase.js +68 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/index.js +53 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/package.json +37 -0
- data/lib/game_dig/node/node_modules/xmlrpc/.idea/date_formatter.js +77 -0
- data/lib/game_dig/node/node_modules/xmlrpc/.npmignore +5 -0
- data/lib/game_dig/node/node_modules/xmlrpc/.travis.yml +6 -0
- data/lib/game_dig/node/node_modules/xmlrpc/HISTORY.md +129 -0
- data/lib/game_dig/node/node_modules/xmlrpc/LICENSE +23 -0
- data/lib/game_dig/node/node_modules/xmlrpc/README.md +235 -0
- data/lib/game_dig/node/node_modules/xmlrpc/lib/client.js +177 -0
- data/lib/game_dig/node/node_modules/xmlrpc/lib/cookies.js +111 -0
- data/lib/game_dig/node/node_modules/xmlrpc/lib/customtype.js +10 -0
- data/lib/game_dig/node/node_modules/xmlrpc/lib/date_formatter.js +188 -0
- data/lib/game_dig/node/node_modules/xmlrpc/lib/deserializer.js +324 -0
- data/lib/game_dig/node/node_modules/xmlrpc/lib/serializer.js +202 -0
- data/lib/game_dig/node/node_modules/xmlrpc/lib/server.js +78 -0
- data/lib/game_dig/node/node_modules/xmlrpc/lib/xmlrpc.js +65 -0
- data/lib/game_dig/node/node_modules/xmlrpc/package.json +35 -0
- data/lib/game_dig/node/node_modules/xmlrpc/tmp/client.js +28 -0
- data/lib/game_dig/node/node_modules/xmlrpc/tmp/server.crt +13 -0
- data/lib/game_dig/node/node_modules/xmlrpc/tmp/server.csr +11 -0
- data/lib/game_dig/node/node_modules/xmlrpc/tmp/server.js +10 -0
- data/lib/game_dig/node/node_modules/xmlrpc/tmp/server.key +15 -0
- data/lib/game_dig/node/node_modules/xmlrpc/tmp/server.key.org +18 -0
- data/lib/game_dig/node/package.json +8 -0
- data/lib/game_dig/node/yarn.lock +359 -0
- data/lib/game_dig/nodo.rb +54 -0
- data/lib/game_dig/query_result.rb +71 -0
- data/lib/game_dig/version.rb +1 -1
- data/lib/game_dig.rb +64 -55
- metadata +742 -16
- data/cli/pry_service.rb +0 -5
- data/lib/custom_errors/game_dig_cli_not_found.rb +0 -2
- data/lib/custom_errors/game_dig_error.rb +0 -2
- data/lib/game_dig/game_dig_helper.rb +0 -68
- data/lib/game_dig/service.rb +0 -38
- data/lib/node/gamedig-service.js +0 -46
- data/lib/node/package.json +0 -9
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
/* eslint-disable node/no-deprecated-api */
|
|
2
|
+
|
|
3
|
+
'use strict'
|
|
4
|
+
|
|
5
|
+
var test = require('tape')
|
|
6
|
+
|
|
7
|
+
var buffer = require('buffer')
|
|
8
|
+
|
|
9
|
+
var index = require('./')
|
|
10
|
+
var safer = require('./safer')
|
|
11
|
+
var dangerous = require('./dangerous')
|
|
12
|
+
|
|
13
|
+
/* Inheritance tests */
|
|
14
|
+
|
|
15
|
+
test('Default is Safer', function (t) {
|
|
16
|
+
t.equal(index, safer)
|
|
17
|
+
t.notEqual(safer, dangerous)
|
|
18
|
+
t.notEqual(index, dangerous)
|
|
19
|
+
t.end()
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
test('Is not a function', function (t) {
|
|
23
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
24
|
+
t.equal(typeof impl, 'object')
|
|
25
|
+
t.equal(typeof impl.Buffer, 'object')
|
|
26
|
+
});
|
|
27
|
+
[buffer].forEach(function (impl) {
|
|
28
|
+
t.equal(typeof impl, 'object')
|
|
29
|
+
t.equal(typeof impl.Buffer, 'function')
|
|
30
|
+
})
|
|
31
|
+
t.end()
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
test('Constructor throws', function (t) {
|
|
35
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
36
|
+
t.throws(function () { impl.Buffer() })
|
|
37
|
+
t.throws(function () { impl.Buffer(0) })
|
|
38
|
+
t.throws(function () { impl.Buffer('a') })
|
|
39
|
+
t.throws(function () { impl.Buffer('a', 'utf-8') })
|
|
40
|
+
t.throws(function () { return new impl.Buffer() })
|
|
41
|
+
t.throws(function () { return new impl.Buffer(0) })
|
|
42
|
+
t.throws(function () { return new impl.Buffer('a') })
|
|
43
|
+
t.throws(function () { return new impl.Buffer('a', 'utf-8') })
|
|
44
|
+
})
|
|
45
|
+
t.end()
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
test('Safe methods exist', function (t) {
|
|
49
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
50
|
+
t.equal(typeof impl.Buffer.alloc, 'function', 'alloc')
|
|
51
|
+
t.equal(typeof impl.Buffer.from, 'function', 'from')
|
|
52
|
+
})
|
|
53
|
+
t.end()
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
test('Unsafe methods exist only in Dangerous', function (t) {
|
|
57
|
+
[index, safer].forEach(function (impl) {
|
|
58
|
+
t.equal(typeof impl.Buffer.allocUnsafe, 'undefined')
|
|
59
|
+
t.equal(typeof impl.Buffer.allocUnsafeSlow, 'undefined')
|
|
60
|
+
});
|
|
61
|
+
[dangerous].forEach(function (impl) {
|
|
62
|
+
t.equal(typeof impl.Buffer.allocUnsafe, 'function')
|
|
63
|
+
t.equal(typeof impl.Buffer.allocUnsafeSlow, 'function')
|
|
64
|
+
})
|
|
65
|
+
t.end()
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
test('Generic methods/properties are defined and equal', function (t) {
|
|
69
|
+
['poolSize', 'isBuffer', 'concat', 'byteLength'].forEach(function (method) {
|
|
70
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
71
|
+
t.equal(impl.Buffer[method], buffer.Buffer[method], method)
|
|
72
|
+
t.notEqual(typeof impl.Buffer[method], 'undefined', method)
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
t.end()
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
test('Built-in buffer static methods/properties are inherited', function (t) {
|
|
79
|
+
Object.keys(buffer).forEach(function (method) {
|
|
80
|
+
if (method === 'SlowBuffer' || method === 'Buffer') return;
|
|
81
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
82
|
+
t.equal(impl[method], buffer[method], method)
|
|
83
|
+
t.notEqual(typeof impl[method], 'undefined', method)
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
t.end()
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
test('Built-in Buffer static methods/properties are inherited', function (t) {
|
|
90
|
+
Object.keys(buffer.Buffer).forEach(function (method) {
|
|
91
|
+
if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return;
|
|
92
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
93
|
+
t.equal(impl.Buffer[method], buffer.Buffer[method], method)
|
|
94
|
+
t.notEqual(typeof impl.Buffer[method], 'undefined', method)
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
t.end()
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
test('.prototype property of Buffer is inherited', function (t) {
|
|
101
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
102
|
+
t.equal(impl.Buffer.prototype, buffer.Buffer.prototype, 'prototype')
|
|
103
|
+
t.notEqual(typeof impl.Buffer.prototype, 'undefined', 'prototype')
|
|
104
|
+
})
|
|
105
|
+
t.end()
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
test('All Safer methods are present in Dangerous', function (t) {
|
|
109
|
+
Object.keys(safer).forEach(function (method) {
|
|
110
|
+
if (method === 'Buffer') return;
|
|
111
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
112
|
+
t.equal(impl[method], safer[method], method)
|
|
113
|
+
if (method !== 'kStringMaxLength') {
|
|
114
|
+
t.notEqual(typeof impl[method], 'undefined', method)
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
})
|
|
118
|
+
Object.keys(safer.Buffer).forEach(function (method) {
|
|
119
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
120
|
+
t.equal(impl.Buffer[method], safer.Buffer[method], method)
|
|
121
|
+
t.notEqual(typeof impl.Buffer[method], 'undefined', method)
|
|
122
|
+
})
|
|
123
|
+
})
|
|
124
|
+
t.end()
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
test('Safe methods from Dangerous methods are present in Safer', function (t) {
|
|
128
|
+
Object.keys(dangerous).forEach(function (method) {
|
|
129
|
+
if (method === 'Buffer') return;
|
|
130
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
131
|
+
t.equal(impl[method], dangerous[method], method)
|
|
132
|
+
if (method !== 'kStringMaxLength') {
|
|
133
|
+
t.notEqual(typeof impl[method], 'undefined', method)
|
|
134
|
+
}
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
Object.keys(dangerous.Buffer).forEach(function (method) {
|
|
138
|
+
if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return;
|
|
139
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
140
|
+
t.equal(impl.Buffer[method], dangerous.Buffer[method], method)
|
|
141
|
+
t.notEqual(typeof impl.Buffer[method], 'undefined', method)
|
|
142
|
+
})
|
|
143
|
+
})
|
|
144
|
+
t.end()
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
/* Behaviour tests */
|
|
148
|
+
|
|
149
|
+
test('Methods return Buffers', function (t) {
|
|
150
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
151
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0)))
|
|
152
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 10)))
|
|
153
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 'a')))
|
|
154
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10)))
|
|
155
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10, 'x')))
|
|
156
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(9, 'ab')))
|
|
157
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('')))
|
|
158
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string')))
|
|
159
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string', 'utf-8')))
|
|
160
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64')))
|
|
161
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([0, 42, 3])))
|
|
162
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(new Uint8Array([0, 42, 3]))))
|
|
163
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([])))
|
|
164
|
+
});
|
|
165
|
+
['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
|
|
166
|
+
t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](0)))
|
|
167
|
+
t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](10)))
|
|
168
|
+
})
|
|
169
|
+
t.end()
|
|
170
|
+
})
|
|
171
|
+
|
|
172
|
+
test('Constructor is buffer.Buffer', function (t) {
|
|
173
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
174
|
+
t.equal(impl.Buffer.alloc(0).constructor, buffer.Buffer)
|
|
175
|
+
t.equal(impl.Buffer.alloc(0, 10).constructor, buffer.Buffer)
|
|
176
|
+
t.equal(impl.Buffer.alloc(0, 'a').constructor, buffer.Buffer)
|
|
177
|
+
t.equal(impl.Buffer.alloc(10).constructor, buffer.Buffer)
|
|
178
|
+
t.equal(impl.Buffer.alloc(10, 'x').constructor, buffer.Buffer)
|
|
179
|
+
t.equal(impl.Buffer.alloc(9, 'ab').constructor, buffer.Buffer)
|
|
180
|
+
t.equal(impl.Buffer.from('').constructor, buffer.Buffer)
|
|
181
|
+
t.equal(impl.Buffer.from('string').constructor, buffer.Buffer)
|
|
182
|
+
t.equal(impl.Buffer.from('string', 'utf-8').constructor, buffer.Buffer)
|
|
183
|
+
t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').constructor, buffer.Buffer)
|
|
184
|
+
t.equal(impl.Buffer.from([0, 42, 3]).constructor, buffer.Buffer)
|
|
185
|
+
t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).constructor, buffer.Buffer)
|
|
186
|
+
t.equal(impl.Buffer.from([]).constructor, buffer.Buffer)
|
|
187
|
+
});
|
|
188
|
+
[0, 10, 100].forEach(function (arg) {
|
|
189
|
+
t.equal(dangerous.Buffer.allocUnsafe(arg).constructor, buffer.Buffer)
|
|
190
|
+
t.equal(dangerous.Buffer.allocUnsafeSlow(arg).constructor, buffer.SlowBuffer(0).constructor)
|
|
191
|
+
})
|
|
192
|
+
t.end()
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
test('Invalid calls throw', function (t) {
|
|
196
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
197
|
+
t.throws(function () { impl.Buffer.from(0) })
|
|
198
|
+
t.throws(function () { impl.Buffer.from(10) })
|
|
199
|
+
t.throws(function () { impl.Buffer.from(10, 'utf-8') })
|
|
200
|
+
t.throws(function () { impl.Buffer.from('string', 'invalid encoding') })
|
|
201
|
+
t.throws(function () { impl.Buffer.from(-10) })
|
|
202
|
+
t.throws(function () { impl.Buffer.from(1e90) })
|
|
203
|
+
t.throws(function () { impl.Buffer.from(Infinity) })
|
|
204
|
+
t.throws(function () { impl.Buffer.from(-Infinity) })
|
|
205
|
+
t.throws(function () { impl.Buffer.from(NaN) })
|
|
206
|
+
t.throws(function () { impl.Buffer.from(null) })
|
|
207
|
+
t.throws(function () { impl.Buffer.from(undefined) })
|
|
208
|
+
t.throws(function () { impl.Buffer.from() })
|
|
209
|
+
t.throws(function () { impl.Buffer.from({}) })
|
|
210
|
+
t.throws(function () { impl.Buffer.alloc('') })
|
|
211
|
+
t.throws(function () { impl.Buffer.alloc('string') })
|
|
212
|
+
t.throws(function () { impl.Buffer.alloc('string', 'utf-8') })
|
|
213
|
+
t.throws(function () { impl.Buffer.alloc('b25ldHdvdGhyZWU=', 'base64') })
|
|
214
|
+
t.throws(function () { impl.Buffer.alloc(-10) })
|
|
215
|
+
t.throws(function () { impl.Buffer.alloc(1e90) })
|
|
216
|
+
t.throws(function () { impl.Buffer.alloc(2 * (1 << 30)) })
|
|
217
|
+
t.throws(function () { impl.Buffer.alloc(Infinity) })
|
|
218
|
+
t.throws(function () { impl.Buffer.alloc(-Infinity) })
|
|
219
|
+
t.throws(function () { impl.Buffer.alloc(null) })
|
|
220
|
+
t.throws(function () { impl.Buffer.alloc(undefined) })
|
|
221
|
+
t.throws(function () { impl.Buffer.alloc() })
|
|
222
|
+
t.throws(function () { impl.Buffer.alloc([]) })
|
|
223
|
+
t.throws(function () { impl.Buffer.alloc([0, 42, 3]) })
|
|
224
|
+
t.throws(function () { impl.Buffer.alloc({}) })
|
|
225
|
+
});
|
|
226
|
+
['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
|
|
227
|
+
t.throws(function () { dangerous.Buffer[method]('') })
|
|
228
|
+
t.throws(function () { dangerous.Buffer[method]('string') })
|
|
229
|
+
t.throws(function () { dangerous.Buffer[method]('string', 'utf-8') })
|
|
230
|
+
t.throws(function () { dangerous.Buffer[method](2 * (1 << 30)) })
|
|
231
|
+
t.throws(function () { dangerous.Buffer[method](Infinity) })
|
|
232
|
+
if (dangerous.Buffer[method] === buffer.Buffer.allocUnsafe) {
|
|
233
|
+
t.skip('Skipping, older impl of allocUnsafe coerced negative sizes to 0')
|
|
234
|
+
} else {
|
|
235
|
+
t.throws(function () { dangerous.Buffer[method](-10) })
|
|
236
|
+
t.throws(function () { dangerous.Buffer[method](-1e90) })
|
|
237
|
+
t.throws(function () { dangerous.Buffer[method](-Infinity) })
|
|
238
|
+
}
|
|
239
|
+
t.throws(function () { dangerous.Buffer[method](null) })
|
|
240
|
+
t.throws(function () { dangerous.Buffer[method](undefined) })
|
|
241
|
+
t.throws(function () { dangerous.Buffer[method]() })
|
|
242
|
+
t.throws(function () { dangerous.Buffer[method]([]) })
|
|
243
|
+
t.throws(function () { dangerous.Buffer[method]([0, 42, 3]) })
|
|
244
|
+
t.throws(function () { dangerous.Buffer[method]({}) })
|
|
245
|
+
})
|
|
246
|
+
t.end()
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
test('Buffers have appropriate lengths', function (t) {
|
|
250
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
251
|
+
t.equal(impl.Buffer.alloc(0).length, 0)
|
|
252
|
+
t.equal(impl.Buffer.alloc(10).length, 10)
|
|
253
|
+
t.equal(impl.Buffer.from('').length, 0)
|
|
254
|
+
t.equal(impl.Buffer.from('string').length, 6)
|
|
255
|
+
t.equal(impl.Buffer.from('string', 'utf-8').length, 6)
|
|
256
|
+
t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').length, 11)
|
|
257
|
+
t.equal(impl.Buffer.from([0, 42, 3]).length, 3)
|
|
258
|
+
t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).length, 3)
|
|
259
|
+
t.equal(impl.Buffer.from([]).length, 0)
|
|
260
|
+
});
|
|
261
|
+
['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
|
|
262
|
+
t.equal(dangerous.Buffer[method](0).length, 0)
|
|
263
|
+
t.equal(dangerous.Buffer[method](10).length, 10)
|
|
264
|
+
})
|
|
265
|
+
t.end()
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
test('Buffers have appropriate lengths (2)', function (t) {
|
|
269
|
+
t.equal(index.Buffer.alloc, safer.Buffer.alloc)
|
|
270
|
+
t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
|
|
271
|
+
var ok = true;
|
|
272
|
+
[ safer.Buffer.alloc,
|
|
273
|
+
dangerous.Buffer.allocUnsafe,
|
|
274
|
+
dangerous.Buffer.allocUnsafeSlow
|
|
275
|
+
].forEach(function (method) {
|
|
276
|
+
for (var i = 0; i < 1e2; i++) {
|
|
277
|
+
var length = Math.round(Math.random() * 1e5)
|
|
278
|
+
var buf = method(length)
|
|
279
|
+
if (!buffer.Buffer.isBuffer(buf)) ok = false
|
|
280
|
+
if (buf.length !== length) ok = false
|
|
281
|
+
}
|
|
282
|
+
})
|
|
283
|
+
t.ok(ok)
|
|
284
|
+
t.end()
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
test('.alloc(size) is zero-filled and has correct length', function (t) {
|
|
288
|
+
t.equal(index.Buffer.alloc, safer.Buffer.alloc)
|
|
289
|
+
t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
|
|
290
|
+
var ok = true
|
|
291
|
+
for (var i = 0; i < 1e2; i++) {
|
|
292
|
+
var length = Math.round(Math.random() * 2e6)
|
|
293
|
+
var buf = index.Buffer.alloc(length)
|
|
294
|
+
if (!buffer.Buffer.isBuffer(buf)) ok = false
|
|
295
|
+
if (buf.length !== length) ok = false
|
|
296
|
+
var j
|
|
297
|
+
for (j = 0; j < length; j++) {
|
|
298
|
+
if (buf[j] !== 0) ok = false
|
|
299
|
+
}
|
|
300
|
+
buf.fill(1)
|
|
301
|
+
for (j = 0; j < length; j++) {
|
|
302
|
+
if (buf[j] !== 1) ok = false
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
t.ok(ok)
|
|
306
|
+
t.end()
|
|
307
|
+
})
|
|
308
|
+
|
|
309
|
+
test('.allocUnsafe / .allocUnsafeSlow are fillable and have correct lengths', function (t) {
|
|
310
|
+
['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
|
|
311
|
+
var ok = true
|
|
312
|
+
for (var i = 0; i < 1e2; i++) {
|
|
313
|
+
var length = Math.round(Math.random() * 2e6)
|
|
314
|
+
var buf = dangerous.Buffer[method](length)
|
|
315
|
+
if (!buffer.Buffer.isBuffer(buf)) ok = false
|
|
316
|
+
if (buf.length !== length) ok = false
|
|
317
|
+
buf.fill(0, 0, length)
|
|
318
|
+
var j
|
|
319
|
+
for (j = 0; j < length; j++) {
|
|
320
|
+
if (buf[j] !== 0) ok = false
|
|
321
|
+
}
|
|
322
|
+
buf.fill(1, 0, length)
|
|
323
|
+
for (j = 0; j < length; j++) {
|
|
324
|
+
if (buf[j] !== 1) ok = false
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
t.ok(ok, method)
|
|
328
|
+
})
|
|
329
|
+
t.end()
|
|
330
|
+
})
|
|
331
|
+
|
|
332
|
+
test('.alloc(size, fill) is `fill`-filled', function (t) {
|
|
333
|
+
t.equal(index.Buffer.alloc, safer.Buffer.alloc)
|
|
334
|
+
t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
|
|
335
|
+
var ok = true
|
|
336
|
+
for (var i = 0; i < 1e2; i++) {
|
|
337
|
+
var length = Math.round(Math.random() * 2e6)
|
|
338
|
+
var fill = Math.round(Math.random() * 255)
|
|
339
|
+
var buf = index.Buffer.alloc(length, fill)
|
|
340
|
+
if (!buffer.Buffer.isBuffer(buf)) ok = false
|
|
341
|
+
if (buf.length !== length) ok = false
|
|
342
|
+
for (var j = 0; j < length; j++) {
|
|
343
|
+
if (buf[j] !== fill) ok = false
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
t.ok(ok)
|
|
347
|
+
t.end()
|
|
348
|
+
})
|
|
349
|
+
|
|
350
|
+
test('.alloc(size, fill) is `fill`-filled', function (t) {
|
|
351
|
+
t.equal(index.Buffer.alloc, safer.Buffer.alloc)
|
|
352
|
+
t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
|
|
353
|
+
var ok = true
|
|
354
|
+
for (var i = 0; i < 1e2; i++) {
|
|
355
|
+
var length = Math.round(Math.random() * 2e6)
|
|
356
|
+
var fill = Math.round(Math.random() * 255)
|
|
357
|
+
var buf = index.Buffer.alloc(length, fill)
|
|
358
|
+
if (!buffer.Buffer.isBuffer(buf)) ok = false
|
|
359
|
+
if (buf.length !== length) ok = false
|
|
360
|
+
for (var j = 0; j < length; j++) {
|
|
361
|
+
if (buf[j] !== fill) ok = false
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
t.ok(ok)
|
|
365
|
+
t.deepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 97))
|
|
366
|
+
t.notDeepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 98))
|
|
367
|
+
|
|
368
|
+
var tmp = new buffer.Buffer(2)
|
|
369
|
+
tmp.fill('ok')
|
|
370
|
+
if (tmp[1] === tmp[0]) {
|
|
371
|
+
// Outdated Node.js
|
|
372
|
+
t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('ooooo'))
|
|
373
|
+
} else {
|
|
374
|
+
t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('okoko'))
|
|
375
|
+
}
|
|
376
|
+
t.notDeepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('kokok'))
|
|
377
|
+
|
|
378
|
+
t.end()
|
|
379
|
+
})
|
|
380
|
+
|
|
381
|
+
test('safer.Buffer.from returns results same as Buffer constructor', function (t) {
|
|
382
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
383
|
+
t.deepEqual(impl.Buffer.from(''), new buffer.Buffer(''))
|
|
384
|
+
t.deepEqual(impl.Buffer.from('string'), new buffer.Buffer('string'))
|
|
385
|
+
t.deepEqual(impl.Buffer.from('string', 'utf-8'), new buffer.Buffer('string', 'utf-8'))
|
|
386
|
+
t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), new buffer.Buffer('b25ldHdvdGhyZWU=', 'base64'))
|
|
387
|
+
t.deepEqual(impl.Buffer.from([0, 42, 3]), new buffer.Buffer([0, 42, 3]))
|
|
388
|
+
t.deepEqual(impl.Buffer.from(new Uint8Array([0, 42, 3])), new buffer.Buffer(new Uint8Array([0, 42, 3])))
|
|
389
|
+
t.deepEqual(impl.Buffer.from([]), new buffer.Buffer([]))
|
|
390
|
+
})
|
|
391
|
+
t.end()
|
|
392
|
+
})
|
|
393
|
+
|
|
394
|
+
test('safer.Buffer.from returns consistent results', function (t) {
|
|
395
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
396
|
+
t.deepEqual(impl.Buffer.from(''), impl.Buffer.alloc(0))
|
|
397
|
+
t.deepEqual(impl.Buffer.from([]), impl.Buffer.alloc(0))
|
|
398
|
+
t.deepEqual(impl.Buffer.from(new Uint8Array([])), impl.Buffer.alloc(0))
|
|
399
|
+
t.deepEqual(impl.Buffer.from('string', 'utf-8'), impl.Buffer.from('string'))
|
|
400
|
+
t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from([115, 116, 114, 105, 110, 103]))
|
|
401
|
+
t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from(impl.Buffer.from('string')))
|
|
402
|
+
t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), impl.Buffer.from('onetwothree'))
|
|
403
|
+
t.notDeepEqual(impl.Buffer.from('b25ldHdvdGhyZWU='), impl.Buffer.from('onetwothree'))
|
|
404
|
+
})
|
|
405
|
+
t.end()
|
|
406
|
+
})
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
The ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
15
|
+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
|
|
17
|
+
====
|
|
18
|
+
|
|
19
|
+
`String.fromCodePoint` by Mathias Bynens used according to terms of MIT
|
|
20
|
+
License, as follows:
|
|
21
|
+
|
|
22
|
+
Copyright Mathias Bynens <https://mathiasbynens.be/>
|
|
23
|
+
|
|
24
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
25
|
+
a copy of this software and associated documentation files (the
|
|
26
|
+
"Software"), to deal in the Software without restriction, including
|
|
27
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
28
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
29
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
30
|
+
the following conditions:
|
|
31
|
+
|
|
32
|
+
The above copyright notice and this permission notice shall be
|
|
33
|
+
included in all copies or substantial portions of the Software.
|
|
34
|
+
|
|
35
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
36
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
37
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
38
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
39
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
40
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
41
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# sax js
|
|
2
|
+
|
|
3
|
+
A sax-style parser for XML and HTML.
|
|
4
|
+
|
|
5
|
+
Designed with [node](http://nodejs.org/) in mind, but should work fine in
|
|
6
|
+
the browser or other CommonJS implementations.
|
|
7
|
+
|
|
8
|
+
## What This Is
|
|
9
|
+
|
|
10
|
+
* A very simple tool to parse through an XML string.
|
|
11
|
+
* A stepping stone to a streaming HTML parser.
|
|
12
|
+
* A handy way to deal with RSS and other mostly-ok-but-kinda-broken XML
|
|
13
|
+
docs.
|
|
14
|
+
|
|
15
|
+
## What This Is (probably) Not
|
|
16
|
+
|
|
17
|
+
* An HTML Parser - That's a fine goal, but this isn't it. It's just
|
|
18
|
+
XML.
|
|
19
|
+
* A DOM Builder - You can use it to build an object model out of XML,
|
|
20
|
+
but it doesn't do that out of the box.
|
|
21
|
+
* XSLT - No DOM = no querying.
|
|
22
|
+
* 100% Compliant with (some other SAX implementation) - Most SAX
|
|
23
|
+
implementations are in Java and do a lot more than this does.
|
|
24
|
+
* An XML Validator - It does a little validation when in strict mode, but
|
|
25
|
+
not much.
|
|
26
|
+
* A Schema-Aware XSD Thing - Schemas are an exercise in fetishistic
|
|
27
|
+
masochism.
|
|
28
|
+
* A DTD-aware Thing - Fetching DTDs is a much bigger job.
|
|
29
|
+
|
|
30
|
+
## Regarding `<!DOCTYPE`s and `<!ENTITY`s
|
|
31
|
+
|
|
32
|
+
The parser will handle the basic XML entities in text nodes and attribute
|
|
33
|
+
values: `& < > ' "`. It's possible to define additional
|
|
34
|
+
entities in XML by putting them in the DTD. This parser doesn't do anything
|
|
35
|
+
with that. If you want to listen to the `ondoctype` event, and then fetch
|
|
36
|
+
the doctypes, and read the entities and add them to `parser.ENTITIES`, then
|
|
37
|
+
be my guest.
|
|
38
|
+
|
|
39
|
+
Unknown entities will fail in strict mode, and in loose mode, will pass
|
|
40
|
+
through unmolested.
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
```javascript
|
|
45
|
+
var sax = require("./lib/sax"),
|
|
46
|
+
strict = true, // set to false for html-mode
|
|
47
|
+
parser = sax.parser(strict);
|
|
48
|
+
|
|
49
|
+
parser.onerror = function (e) {
|
|
50
|
+
// an error happened.
|
|
51
|
+
};
|
|
52
|
+
parser.ontext = function (t) {
|
|
53
|
+
// got some text. t is the string of text.
|
|
54
|
+
};
|
|
55
|
+
parser.onopentag = function (node) {
|
|
56
|
+
// opened a tag. node has "name" and "attributes"
|
|
57
|
+
};
|
|
58
|
+
parser.onattribute = function (attr) {
|
|
59
|
+
// an attribute. attr has "name" and "value"
|
|
60
|
+
};
|
|
61
|
+
parser.onend = function () {
|
|
62
|
+
// parser stream is done, and ready to have more stuff written to it.
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
parser.write('<xml>Hello, <who name="world">world</who>!</xml>').close();
|
|
66
|
+
|
|
67
|
+
// stream usage
|
|
68
|
+
// takes the same options as the parser
|
|
69
|
+
var saxStream = require("sax").createStream(strict, options)
|
|
70
|
+
saxStream.on("error", function (e) {
|
|
71
|
+
// unhandled errors will throw, since this is a proper node
|
|
72
|
+
// event emitter.
|
|
73
|
+
console.error("error!", e)
|
|
74
|
+
// clear the error
|
|
75
|
+
this._parser.error = null
|
|
76
|
+
this._parser.resume()
|
|
77
|
+
})
|
|
78
|
+
saxStream.on("opentag", function (node) {
|
|
79
|
+
// same object as above
|
|
80
|
+
})
|
|
81
|
+
// pipe is supported, and it's readable/writable
|
|
82
|
+
// same chunks coming in also go out.
|
|
83
|
+
fs.createReadStream("file.xml")
|
|
84
|
+
.pipe(saxStream)
|
|
85
|
+
.pipe(fs.createWriteStream("file-copy.xml"))
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
## Arguments
|
|
90
|
+
|
|
91
|
+
Pass the following arguments to the parser function. All are optional.
|
|
92
|
+
|
|
93
|
+
`strict` - Boolean. Whether or not to be a jerk. Default: `false`.
|
|
94
|
+
|
|
95
|
+
`opt` - Object bag of settings regarding string formatting. All default to `false`.
|
|
96
|
+
|
|
97
|
+
Settings supported:
|
|
98
|
+
|
|
99
|
+
* `trim` - Boolean. Whether or not to trim text and comment nodes.
|
|
100
|
+
* `normalize` - Boolean. If true, then turn any whitespace into a single
|
|
101
|
+
space.
|
|
102
|
+
* `lowercase` - Boolean. If true, then lowercase tag names and attribute names
|
|
103
|
+
in loose mode, rather than uppercasing them.
|
|
104
|
+
* `xmlns` - Boolean. If true, then namespaces are supported.
|
|
105
|
+
* `position` - Boolean. If false, then don't track line/col/position.
|
|
106
|
+
* `strictEntities` - Boolean. If true, only parse [predefined XML
|
|
107
|
+
entities](http://www.w3.org/TR/REC-xml/#sec-predefined-ent)
|
|
108
|
+
(`&`, `'`, `>`, `<`, and `"`)
|
|
109
|
+
|
|
110
|
+
## Methods
|
|
111
|
+
|
|
112
|
+
`write` - Write bytes onto the stream. You don't have to do this all at
|
|
113
|
+
once. You can keep writing as much as you want.
|
|
114
|
+
|
|
115
|
+
`close` - Close the stream. Once closed, no more data may be written until
|
|
116
|
+
it is done processing the buffer, which is signaled by the `end` event.
|
|
117
|
+
|
|
118
|
+
`resume` - To gracefully handle errors, assign a listener to the `error`
|
|
119
|
+
event. Then, when the error is taken care of, you can call `resume` to
|
|
120
|
+
continue parsing. Otherwise, the parser will not continue while in an error
|
|
121
|
+
state.
|
|
122
|
+
|
|
123
|
+
## Members
|
|
124
|
+
|
|
125
|
+
At all times, the parser object will have the following members:
|
|
126
|
+
|
|
127
|
+
`line`, `column`, `position` - Indications of the position in the XML
|
|
128
|
+
document where the parser currently is looking.
|
|
129
|
+
|
|
130
|
+
`startTagPosition` - Indicates the position where the current tag starts.
|
|
131
|
+
|
|
132
|
+
`closed` - Boolean indicating whether or not the parser can be written to.
|
|
133
|
+
If it's `true`, then wait for the `ready` event to write again.
|
|
134
|
+
|
|
135
|
+
`strict` - Boolean indicating whether or not the parser is a jerk.
|
|
136
|
+
|
|
137
|
+
`opt` - Any options passed into the constructor.
|
|
138
|
+
|
|
139
|
+
`tag` - The current tag being dealt with.
|
|
140
|
+
|
|
141
|
+
And a bunch of other stuff that you probably shouldn't touch.
|
|
142
|
+
|
|
143
|
+
## Events
|
|
144
|
+
|
|
145
|
+
All events emit with a single argument. To listen to an event, assign a
|
|
146
|
+
function to `on<eventname>`. Functions get executed in the this-context of
|
|
147
|
+
the parser object. The list of supported events are also in the exported
|
|
148
|
+
`EVENTS` array.
|
|
149
|
+
|
|
150
|
+
When using the stream interface, assign handlers using the EventEmitter
|
|
151
|
+
`on` function in the normal fashion.
|
|
152
|
+
|
|
153
|
+
`error` - Indication that something bad happened. The error will be hanging
|
|
154
|
+
out on `parser.error`, and must be deleted before parsing can continue. By
|
|
155
|
+
listening to this event, you can keep an eye on that kind of stuff. Note:
|
|
156
|
+
this happens *much* more in strict mode. Argument: instance of `Error`.
|
|
157
|
+
|
|
158
|
+
`text` - Text node. Argument: string of text.
|
|
159
|
+
|
|
160
|
+
`doctype` - The `<!DOCTYPE` declaration. Argument: doctype string.
|
|
161
|
+
|
|
162
|
+
`processinginstruction` - Stuff like `<?xml foo="blerg" ?>`. Argument:
|
|
163
|
+
object with `name` and `body` members. Attributes are not parsed, as
|
|
164
|
+
processing instructions have implementation dependent semantics.
|
|
165
|
+
|
|
166
|
+
`sgmldeclaration` - Random SGML declarations. Stuff like `<!ENTITY p>`
|
|
167
|
+
would trigger this kind of event. This is a weird thing to support, so it
|
|
168
|
+
might go away at some point. SAX isn't intended to be used to parse SGML,
|
|
169
|
+
after all.
|
|
170
|
+
|
|
171
|
+
`opentagstart` - Emitted immediately when the tag name is available,
|
|
172
|
+
but before any attributes are encountered. Argument: object with a
|
|
173
|
+
`name` field and an empty `attributes` set. Note that this is the
|
|
174
|
+
same object that will later be emitted in the `opentag` event.
|
|
175
|
+
|
|
176
|
+
`opentag` - An opening tag. Argument: object with `name` and `attributes`.
|
|
177
|
+
In non-strict mode, tag names are uppercased, unless the `lowercase`
|
|
178
|
+
option is set. If the `xmlns` option is set, then it will contain
|
|
179
|
+
namespace binding information on the `ns` member, and will have a
|
|
180
|
+
`local`, `prefix`, and `uri` member.
|
|
181
|
+
|
|
182
|
+
`closetag` - A closing tag. In loose mode, tags are auto-closed if their
|
|
183
|
+
parent closes. In strict mode, well-formedness is enforced. Note that
|
|
184
|
+
self-closing tags will have `closeTag` emitted immediately after `openTag`.
|
|
185
|
+
Argument: tag name.
|
|
186
|
+
|
|
187
|
+
`attribute` - An attribute node. Argument: object with `name` and `value`.
|
|
188
|
+
In non-strict mode, attribute names are uppercased, unless the `lowercase`
|
|
189
|
+
option is set. If the `xmlns` option is set, it will also contains namespace
|
|
190
|
+
information.
|
|
191
|
+
|
|
192
|
+
`comment` - A comment node. Argument: the string of the comment.
|
|
193
|
+
|
|
194
|
+
`opencdata` - The opening tag of a `<![CDATA[` block.
|
|
195
|
+
|
|
196
|
+
`cdata` - The text of a `<![CDATA[` block. Since `<![CDATA[` blocks can get
|
|
197
|
+
quite large, this event may fire multiple times for a single block, if it
|
|
198
|
+
is broken up into multiple `write()`s. Argument: the string of random
|
|
199
|
+
character data.
|
|
200
|
+
|
|
201
|
+
`closecdata` - The closing tag (`]]>`) of a `<![CDATA[` block.
|
|
202
|
+
|
|
203
|
+
`opennamespace` - If the `xmlns` option is set, then this event will
|
|
204
|
+
signal the start of a new namespace binding.
|
|
205
|
+
|
|
206
|
+
`closenamespace` - If the `xmlns` option is set, then this event will
|
|
207
|
+
signal the end of a namespace binding.
|
|
208
|
+
|
|
209
|
+
`end` - Indication that the closed stream has ended.
|
|
210
|
+
|
|
211
|
+
`ready` - Indication that the stream has reset, and is ready to be written
|
|
212
|
+
to.
|
|
213
|
+
|
|
214
|
+
`noscript` - In non-strict mode, `<script>` tags trigger a `"script"`
|
|
215
|
+
event, and their contents are not checked for special xml characters.
|
|
216
|
+
If you pass `noscript: true`, then this behavior is suppressed.
|
|
217
|
+
|
|
218
|
+
## Reporting Problems
|
|
219
|
+
|
|
220
|
+
It's best to write a failing test if you find an issue. I will always
|
|
221
|
+
accept pull requests with failing tests if they demonstrate intended
|
|
222
|
+
behavior, but it is very hard to figure out what issue you're describing
|
|
223
|
+
without a test. Writing a test is also the best way for you yourself
|
|
224
|
+
to figure out if you really understand the issue you think you have with
|
|
225
|
+
sax-js.
|