rahad-media-downloader 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/.cache/nix/binary-cache-v6.sqlite +0 -0
- package/.cache/nix/binary-cache-v6.sqlite-journal +0 -0
- package/.cache/replit/__replit_disk_meta.json +1 -0
- package/.cache/replit/modules/nodejs-20:v32-20240401-269b323.res +1 -0
- package/.cache/replit/modules/replit:v8-20240329-787bc7d.res +1 -0
- package/.cache/replit/modules.stamp +0 -0
- package/.cache/replit/nix/env.json +1 -0
- package/.cache/typescript/5.0/node_modules/.package-lock.json +12 -0
- package/.cache/typescript/5.0/node_modules/types-registry/README.md +2 -0
- package/.cache/typescript/5.0/node_modules/types-registry/index.json +1 -0
- package/.cache/typescript/5.0/node_modules/types-registry/package.json +20 -0
- package/.cache/typescript/5.0/package-lock.json +17 -0
- package/.cache/typescript/5.0/package.json +1 -0
- package/.cache/typescript/5.3/node_modules/.package-lock.json +181 -0
- package/.cache/typescript/5.3/node_modules/@types/caseless/LICENSE +21 -0
- package/.cache/typescript/5.3/node_modules/@types/caseless/README.md +48 -0
- package/.cache/typescript/5.3/node_modules/@types/caseless/index.d.ts +29 -0
- package/.cache/typescript/5.3/node_modules/@types/caseless/package.json +35 -0
- package/.cache/typescript/5.3/node_modules/@types/cheerio/LICENSE +21 -0
- package/.cache/typescript/5.3/node_modules/@types/cheerio/README.md +15 -0
- package/.cache/typescript/5.3/node_modules/@types/cheerio/index.d.ts +318 -0
- package/.cache/typescript/5.3/node_modules/@types/cheerio/package.json +71 -0
- package/.cache/typescript/5.3/node_modules/@types/jsdom/LICENSE +21 -0
- package/.cache/typescript/5.3/node_modules/@types/jsdom/README.md +15 -0
- package/.cache/typescript/5.3/node_modules/@types/jsdom/base.d.ts +456 -0
- package/.cache/typescript/5.3/node_modules/@types/jsdom/index.d.ts +18 -0
- package/.cache/typescript/5.3/node_modules/@types/jsdom/package.json +45 -0
- package/.cache/typescript/5.3/node_modules/@types/node/LICENSE +21 -0
- package/.cache/typescript/5.3/node_modules/@types/node/README.md +15 -0
- package/.cache/typescript/5.3/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/.cache/typescript/5.3/node_modules/@types/node/assert.d.ts +996 -0
- package/.cache/typescript/5.3/node_modules/@types/node/async_hooks.d.ts +539 -0
- package/.cache/typescript/5.3/node_modules/@types/node/buffer.d.ts +2362 -0
- package/.cache/typescript/5.3/node_modules/@types/node/child_process.d.ts +1540 -0
- package/.cache/typescript/5.3/node_modules/@types/node/cluster.d.ts +432 -0
- package/.cache/typescript/5.3/node_modules/@types/node/console.d.ts +415 -0
- package/.cache/typescript/5.3/node_modules/@types/node/constants.d.ts +19 -0
- package/.cache/typescript/5.3/node_modules/@types/node/crypto.d.ts +4456 -0
- package/.cache/typescript/5.3/node_modules/@types/node/dgram.d.ts +586 -0
- package/.cache/typescript/5.3/node_modules/@types/node/diagnostics_channel.d.ts +191 -0
- package/.cache/typescript/5.3/node_modules/@types/node/dns/promises.d.ts +425 -0
- package/.cache/typescript/5.3/node_modules/@types/node/dns.d.ts +809 -0
- package/.cache/typescript/5.3/node_modules/@types/node/dom-events.d.ts +122 -0
- package/.cache/typescript/5.3/node_modules/@types/node/domain.d.ts +170 -0
- package/.cache/typescript/5.3/node_modules/@types/node/events.d.ts +879 -0
- package/.cache/typescript/5.3/node_modules/@types/node/fs/promises.d.ts +1239 -0
- package/.cache/typescript/5.3/node_modules/@types/node/fs.d.ts +4291 -0
- package/.cache/typescript/5.3/node_modules/@types/node/globals.d.ts +385 -0
- package/.cache/typescript/5.3/node_modules/@types/node/globals.global.d.ts +1 -0
- package/.cache/typescript/5.3/node_modules/@types/node/http.d.ts +1888 -0
- package/.cache/typescript/5.3/node_modules/@types/node/http2.d.ts +2382 -0
- package/.cache/typescript/5.3/node_modules/@types/node/https.d.ts +550 -0
- package/.cache/typescript/5.3/node_modules/@types/node/index.d.ts +88 -0
- package/.cache/typescript/5.3/node_modules/@types/node/inspector.d.ts +2747 -0
- package/.cache/typescript/5.3/node_modules/@types/node/module.d.ts +301 -0
- package/.cache/typescript/5.3/node_modules/@types/node/net.d.ts +949 -0
- package/.cache/typescript/5.3/node_modules/@types/node/os.d.ts +478 -0
- package/.cache/typescript/5.3/node_modules/@types/node/package.json +230 -0
- package/.cache/typescript/5.3/node_modules/@types/node/path.d.ts +191 -0
- package/.cache/typescript/5.3/node_modules/@types/node/perf_hooks.d.ts +639 -0
- package/.cache/typescript/5.3/node_modules/@types/node/process.d.ts +1539 -0
- package/.cache/typescript/5.3/node_modules/@types/node/punycode.d.ts +117 -0
- package/.cache/typescript/5.3/node_modules/@types/node/querystring.d.ts +141 -0
- package/.cache/typescript/5.3/node_modules/@types/node/readline/promises.d.ts +150 -0
- package/.cache/typescript/5.3/node_modules/@types/node/readline.d.ts +539 -0
- package/.cache/typescript/5.3/node_modules/@types/node/repl.d.ts +430 -0
- package/.cache/typescript/5.3/node_modules/@types/node/stream/consumers.d.ts +12 -0
- package/.cache/typescript/5.3/node_modules/@types/node/stream/promises.d.ts +83 -0
- package/.cache/typescript/5.3/node_modules/@types/node/stream/web.d.ts +350 -0
- package/.cache/typescript/5.3/node_modules/@types/node/stream.d.ts +1701 -0
- package/.cache/typescript/5.3/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/.cache/typescript/5.3/node_modules/@types/node/test.d.ts +1382 -0
- package/.cache/typescript/5.3/node_modules/@types/node/timers/promises.d.ts +93 -0
- package/.cache/typescript/5.3/node_modules/@types/node/timers.d.ts +240 -0
- package/.cache/typescript/5.3/node_modules/@types/node/tls.d.ts +1210 -0
- package/.cache/typescript/5.3/node_modules/@types/node/trace_events.d.ts +182 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/assert.d.ts +996 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/async_hooks.d.ts +539 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/buffer.d.ts +2362 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/child_process.d.ts +1540 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/cluster.d.ts +432 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/console.d.ts +415 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/constants.d.ts +19 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/crypto.d.ts +4455 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/dgram.d.ts +586 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +191 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/dns/promises.d.ts +425 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/dns.d.ts +809 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/dom-events.d.ts +122 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/events.d.ts +879 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/fs/promises.d.ts +1239 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/fs.d.ts +4291 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/globals.d.ts +385 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/http.d.ts +1888 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/http2.d.ts +2382 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/https.d.ts +550 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/index.d.ts +88 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/inspector.d.ts +2747 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/module.d.ts +301 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/net.d.ts +949 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/os.d.ts +478 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/path.d.ts +191 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/perf_hooks.d.ts +639 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/process.d.ts +1539 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/querystring.d.ts +141 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/readline/promises.d.ts +150 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/readline.d.ts +539 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/repl.d.ts +430 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/stream/promises.d.ts +83 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/stream/web.d.ts +350 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/stream.d.ts +1701 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/test.d.ts +1382 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/timers.d.ts +240 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/tls.d.ts +1210 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/trace_events.d.ts +182 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/tty.d.ts +208 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/url.d.ts +927 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/util.d.ts +2183 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/v8.d.ts +635 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/vm.d.ts +903 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/wasi.d.ts +158 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/worker_threads.d.ts +691 -0
- package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
- package/.cache/typescript/5.3/node_modules/@types/node/tty.d.ts +208 -0
- package/.cache/typescript/5.3/node_modules/@types/node/url.d.ts +927 -0
- package/.cache/typescript/5.3/node_modules/@types/node/util.d.ts +2183 -0
- package/.cache/typescript/5.3/node_modules/@types/node/v8.d.ts +635 -0
- package/.cache/typescript/5.3/node_modules/@types/node/vm.d.ts +903 -0
- package/.cache/typescript/5.3/node_modules/@types/node/wasi.d.ts +158 -0
- package/.cache/typescript/5.3/node_modules/@types/node/worker_threads.d.ts +691 -0
- package/.cache/typescript/5.3/node_modules/@types/node/zlib.d.ts +517 -0
- package/.cache/typescript/5.3/node_modules/@types/node-fetch/LICENSE +21 -0
- package/.cache/typescript/5.3/node_modules/@types/node-fetch/README.md +15 -0
- package/.cache/typescript/5.3/node_modules/@types/node-fetch/externals.d.ts +32 -0
- package/.cache/typescript/5.3/node_modules/@types/node-fetch/index.d.ts +214 -0
- package/.cache/typescript/5.3/node_modules/@types/node-fetch/package.json +83 -0
- package/.cache/typescript/5.3/node_modules/@types/request/LICENSE +21 -0
- package/.cache/typescript/5.3/node_modules/@types/request/README.md +15 -0
- package/.cache/typescript/5.3/node_modules/@types/request/index.d.ts +395 -0
- package/.cache/typescript/5.3/node_modules/@types/request/node_modules/form-data/License +19 -0
- package/.cache/typescript/5.3/node_modules/@types/request/node_modules/form-data/README.md +350 -0
- package/.cache/typescript/5.3/node_modules/@types/request/node_modules/form-data/README.md.bak +350 -0
- package/.cache/typescript/5.3/node_modules/@types/request/node_modules/form-data/index.d.ts +51 -0
- package/.cache/typescript/5.3/node_modules/@types/request/node_modules/form-data/lib/browser.js +2 -0
- package/.cache/typescript/5.3/node_modules/@types/request/node_modules/form-data/lib/form_data.js +483 -0
- package/.cache/typescript/5.3/node_modules/@types/request/node_modules/form-data/lib/populate.js +10 -0
- package/.cache/typescript/5.3/node_modules/@types/request/node_modules/form-data/package.json +68 -0
- package/.cache/typescript/5.3/node_modules/@types/request/package.json +70 -0
- package/.cache/typescript/5.3/node_modules/@types/tough-cookie/LICENSE +21 -0
- package/.cache/typescript/5.3/node_modules/@types/tough-cookie/README.md +15 -0
- package/.cache/typescript/5.3/node_modules/@types/tough-cookie/index.d.ts +321 -0
- package/.cache/typescript/5.3/node_modules/@types/tough-cookie/package.json +35 -0
- package/.cache/typescript/5.3/node_modules/asynckit/LICENSE +21 -0
- package/.cache/typescript/5.3/node_modules/asynckit/README.md +233 -0
- package/.cache/typescript/5.3/node_modules/asynckit/bench.js +76 -0
- package/.cache/typescript/5.3/node_modules/asynckit/index.js +6 -0
- package/.cache/typescript/5.3/node_modules/asynckit/lib/abort.js +29 -0
- package/.cache/typescript/5.3/node_modules/asynckit/lib/async.js +34 -0
- package/.cache/typescript/5.3/node_modules/asynckit/lib/defer.js +26 -0
- package/.cache/typescript/5.3/node_modules/asynckit/lib/iterate.js +75 -0
- package/.cache/typescript/5.3/node_modules/asynckit/lib/readable_asynckit.js +91 -0
- package/.cache/typescript/5.3/node_modules/asynckit/lib/readable_parallel.js +25 -0
- package/.cache/typescript/5.3/node_modules/asynckit/lib/readable_serial.js +25 -0
- package/.cache/typescript/5.3/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
- package/.cache/typescript/5.3/node_modules/asynckit/lib/state.js +37 -0
- package/.cache/typescript/5.3/node_modules/asynckit/lib/streamify.js +141 -0
- package/.cache/typescript/5.3/node_modules/asynckit/lib/terminator.js +29 -0
- package/.cache/typescript/5.3/node_modules/asynckit/package.json +63 -0
- package/.cache/typescript/5.3/node_modules/asynckit/parallel.js +43 -0
- package/.cache/typescript/5.3/node_modules/asynckit/serial.js +17 -0
- package/.cache/typescript/5.3/node_modules/asynckit/serialOrdered.js +75 -0
- package/.cache/typescript/5.3/node_modules/asynckit/stream.js +21 -0
- package/.cache/typescript/5.3/node_modules/combined-stream/License +19 -0
- package/.cache/typescript/5.3/node_modules/combined-stream/Readme.md +138 -0
- package/.cache/typescript/5.3/node_modules/combined-stream/lib/combined_stream.js +208 -0
- package/.cache/typescript/5.3/node_modules/combined-stream/package.json +25 -0
- package/.cache/typescript/5.3/node_modules/combined-stream/yarn.lock +17 -0
- package/.cache/typescript/5.3/node_modules/delayed-stream/License +19 -0
- package/.cache/typescript/5.3/node_modules/delayed-stream/Makefile +7 -0
- package/.cache/typescript/5.3/node_modules/delayed-stream/Readme.md +141 -0
- package/.cache/typescript/5.3/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
- package/.cache/typescript/5.3/node_modules/delayed-stream/package.json +27 -0
- package/.cache/typescript/5.3/node_modules/entities/LICENSE +11 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/decode.d.ts +211 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/decode.d.ts.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/decode.js +536 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/decode.js.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/decode_codepoint.d.ts +19 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/decode_codepoint.d.ts.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/decode_codepoint.js +76 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/decode_codepoint.js.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/encode.d.ts +22 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/encode.d.ts.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/encode.js +77 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/encode.js.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/escape.d.ts +43 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/escape.d.ts.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/escape.js +122 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/escape.js.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/decode.d.ts +211 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/decode.d.ts.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/decode.js +496 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/decode.js.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/decode_codepoint.d.ts +19 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/decode_codepoint.d.ts.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/decode_codepoint.js +71 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/decode_codepoint.js.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/encode.d.ts +22 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/encode.d.ts.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/encode.js +69 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/encode.js.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/escape.d.ts +43 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/escape.d.ts.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/escape.js +116 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/escape.js.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +3 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/generated/decode-data-html.d.ts.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/generated/decode-data-html.js +7 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/generated/decode-data-html.js.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +3 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/generated/decode-data-xml.js +7 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/generated/decode-data-xml.js.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/generated/encode-html.d.ts +8 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/generated/encode-html.d.ts.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/generated/encode-html.js +10 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/generated/encode-html.js.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/index.d.ts +96 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/index.d.ts.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/index.js +99 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/index.js.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/esm/package.json +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/generated/decode-data-html.d.ts +3 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/generated/decode-data-html.d.ts.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/generated/decode-data-html.js +9 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/generated/decode-data-html.js.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/generated/decode-data-xml.d.ts +3 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/generated/decode-data-xml.d.ts.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/generated/decode-data-xml.js +9 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/generated/decode-data-xml.js.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/generated/encode-html.d.ts +8 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/generated/encode-html.d.ts.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/generated/encode-html.js +12 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/generated/encode-html.js.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/index.d.ts +96 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/index.d.ts.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/index.js +126 -0
- package/.cache/typescript/5.3/node_modules/entities/lib/index.js.map +1 -0
- package/.cache/typescript/5.3/node_modules/entities/package.json +90 -0
- package/.cache/typescript/5.3/node_modules/entities/readme.md +122 -0
- package/.cache/typescript/5.3/node_modules/form-data/License +19 -0
- package/.cache/typescript/5.3/node_modules/form-data/README.md.bak +358 -0
- package/.cache/typescript/5.3/node_modules/form-data/Readme.md +358 -0
- package/.cache/typescript/5.3/node_modules/form-data/index.d.ts +62 -0
- package/.cache/typescript/5.3/node_modules/form-data/lib/browser.js +2 -0
- package/.cache/typescript/5.3/node_modules/form-data/lib/form_data.js +501 -0
- package/.cache/typescript/5.3/node_modules/form-data/lib/populate.js +10 -0
- package/.cache/typescript/5.3/node_modules/form-data/package.json +68 -0
- package/.cache/typescript/5.3/node_modules/mime-db/HISTORY.md +507 -0
- package/.cache/typescript/5.3/node_modules/mime-db/LICENSE +23 -0
- package/.cache/typescript/5.3/node_modules/mime-db/README.md +100 -0
- package/.cache/typescript/5.3/node_modules/mime-db/db.json +8519 -0
- package/.cache/typescript/5.3/node_modules/mime-db/index.js +12 -0
- package/.cache/typescript/5.3/node_modules/mime-db/package.json +60 -0
- package/.cache/typescript/5.3/node_modules/mime-types/HISTORY.md +397 -0
- package/.cache/typescript/5.3/node_modules/mime-types/LICENSE +23 -0
- package/.cache/typescript/5.3/node_modules/mime-types/README.md +113 -0
- package/.cache/typescript/5.3/node_modules/mime-types/index.js +188 -0
- package/.cache/typescript/5.3/node_modules/mime-types/package.json +44 -0
- package/.cache/typescript/5.3/node_modules/parse5/LICENSE +19 -0
- package/.cache/typescript/5.3/node_modules/parse5/README.md +38 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/common/doctype.d.ts +5 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/common/doctype.js +120 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/common/error-codes.d.ts +68 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/common/error-codes.js +67 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/common/foreign-content.d.ts +10 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/common/foreign-content.js +239 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/common/html.d.ts +288 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/common/html.js +529 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/common/token.d.ts +85 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/common/token.js +25 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/common/unicode.d.ts +49 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/common/unicode.js +77 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/index.d.ts +60 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/index.js +57 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/package.json +1 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/parser/formatting-element-list.d.ts +37 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/parser/formatting-element-list.js +115 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/parser/index.d.ts +157 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/parser/index.js +3163 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/parser/open-element-stack.d.ts +53 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/parser/open-element-stack.js +316 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/serializer/index.d.ts +61 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/serializer/index.js +173 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/tokenizer/index.d.ts +248 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/tokenizer/index.js +2908 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/tokenizer/preprocessor.d.ts +37 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/tokenizer/preprocessor.js +199 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/tree-adapters/default.d.ts +85 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/tree-adapters/default.js +177 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/tree-adapters/interface.d.ts +250 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/cjs/tree-adapters/interface.js +3 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/common/doctype.d.ts +5 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/common/doctype.js +115 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/common/error-codes.d.ts +68 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/common/error-codes.js +64 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/common/foreign-content.d.ts +10 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/common/foreign-content.js +230 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/common/html.d.ts +288 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/common/html.js +523 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/common/token.d.ts +85 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/common/token.js +21 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/common/unicode.d.ts +49 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/common/unicode.js +69 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/index.d.ts +60 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/index.js +45 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/parser/formatting-element-list.d.ts +37 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/parser/formatting-element-list.js +111 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/parser/index.d.ts +157 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/parser/index.js +3168 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/parser/open-element-stack.d.ts +53 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/parser/open-element-stack.js +312 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/serializer/index.d.ts +61 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/serializer/index.js +168 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/tokenizer/index.d.ts +248 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/tokenizer/index.js +2904 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/tokenizer/preprocessor.d.ts +37 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/tokenizer/preprocessor.js +195 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/tree-adapters/default.d.ts +85 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/tree-adapters/default.js +174 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/tree-adapters/interface.d.ts +250 -0
- package/.cache/typescript/5.3/node_modules/parse5/dist/tree-adapters/interface.js +2 -0
- package/.cache/typescript/5.3/node_modules/parse5/package.json +50 -0
- package/.cache/typescript/5.3/node_modules/types-registry/README.md +2 -0
- package/.cache/typescript/5.3/node_modules/types-registry/index.json +1 -0
- package/.cache/typescript/5.3/node_modules/types-registry/package.json +20 -0
- package/.cache/typescript/5.3/node_modules/undici-types/README.md +6 -0
- package/.cache/typescript/5.3/node_modules/undici-types/agent.d.ts +31 -0
- package/.cache/typescript/5.3/node_modules/undici-types/api.d.ts +43 -0
- package/.cache/typescript/5.3/node_modules/undici-types/balanced-pool.d.ts +18 -0
- package/.cache/typescript/5.3/node_modules/undici-types/cache.d.ts +36 -0
- package/.cache/typescript/5.3/node_modules/undici-types/client.d.ts +97 -0
- package/.cache/typescript/5.3/node_modules/undici-types/connector.d.ts +34 -0
- package/.cache/typescript/5.3/node_modules/undici-types/content-type.d.ts +21 -0
- package/.cache/typescript/5.3/node_modules/undici-types/cookies.d.ts +28 -0
- package/.cache/typescript/5.3/node_modules/undici-types/diagnostics-channel.d.ts +67 -0
- package/.cache/typescript/5.3/node_modules/undici-types/dispatcher.d.ts +241 -0
- package/.cache/typescript/5.3/node_modules/undici-types/errors.d.ts +128 -0
- package/.cache/typescript/5.3/node_modules/undici-types/fetch.d.ts +209 -0
- package/.cache/typescript/5.3/node_modules/undici-types/file.d.ts +39 -0
- package/.cache/typescript/5.3/node_modules/undici-types/filereader.d.ts +54 -0
- package/.cache/typescript/5.3/node_modules/undici-types/formdata.d.ts +108 -0
- package/.cache/typescript/5.3/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/.cache/typescript/5.3/node_modules/undici-types/global-origin.d.ts +7 -0
- package/.cache/typescript/5.3/node_modules/undici-types/handlers.d.ts +9 -0
- package/.cache/typescript/5.3/node_modules/undici-types/header.d.ts +4 -0
- package/.cache/typescript/5.3/node_modules/undici-types/index.d.ts +63 -0
- package/.cache/typescript/5.3/node_modules/undici-types/interceptors.d.ts +5 -0
- package/.cache/typescript/5.3/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/.cache/typescript/5.3/node_modules/undici-types/mock-client.d.ts +25 -0
- package/.cache/typescript/5.3/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/.cache/typescript/5.3/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/.cache/typescript/5.3/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/.cache/typescript/5.3/node_modules/undici-types/package.json +55 -0
- package/.cache/typescript/5.3/node_modules/undici-types/patch.d.ts +71 -0
- package/.cache/typescript/5.3/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/.cache/typescript/5.3/node_modules/undici-types/pool.d.ts +28 -0
- package/.cache/typescript/5.3/node_modules/undici-types/proxy-agent.d.ts +30 -0
- package/.cache/typescript/5.3/node_modules/undici-types/readable.d.ts +61 -0
- package/.cache/typescript/5.3/node_modules/undici-types/webidl.d.ts +220 -0
- package/.cache/typescript/5.3/node_modules/undici-types/websocket.d.ts +131 -0
- package/.cache/typescript/5.3/package-lock.json +192 -0
- package/.cache/typescript/5.3/package.json +1 -0
- package/.replit +17 -0
- package/README.md +130 -0
- package/index.js +1 -0
- package/package.json +28 -0
- package/replit.nix +3 -0
@@ -0,0 +1,141 @@
|
|
1
|
+
# delayed-stream
|
2
|
+
|
3
|
+
Buffers events from a stream until you are ready to handle them.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
``` bash
|
8
|
+
npm install delayed-stream
|
9
|
+
```
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
The following example shows how to write a http echo server that delays its
|
14
|
+
response by 1000 ms.
|
15
|
+
|
16
|
+
``` javascript
|
17
|
+
var DelayedStream = require('delayed-stream');
|
18
|
+
var http = require('http');
|
19
|
+
|
20
|
+
http.createServer(function(req, res) {
|
21
|
+
var delayed = DelayedStream.create(req);
|
22
|
+
|
23
|
+
setTimeout(function() {
|
24
|
+
res.writeHead(200);
|
25
|
+
delayed.pipe(res);
|
26
|
+
}, 1000);
|
27
|
+
});
|
28
|
+
```
|
29
|
+
|
30
|
+
If you are not using `Stream#pipe`, you can also manually release the buffered
|
31
|
+
events by calling `delayedStream.resume()`:
|
32
|
+
|
33
|
+
``` javascript
|
34
|
+
var delayed = DelayedStream.create(req);
|
35
|
+
|
36
|
+
setTimeout(function() {
|
37
|
+
// Emit all buffered events and resume underlaying source
|
38
|
+
delayed.resume();
|
39
|
+
}, 1000);
|
40
|
+
```
|
41
|
+
|
42
|
+
## Implementation
|
43
|
+
|
44
|
+
In order to use this meta stream properly, here are a few things you should
|
45
|
+
know about the implementation.
|
46
|
+
|
47
|
+
### Event Buffering / Proxying
|
48
|
+
|
49
|
+
All events of the `source` stream are hijacked by overwriting the `source.emit`
|
50
|
+
method. Until node implements a catch-all event listener, this is the only way.
|
51
|
+
|
52
|
+
However, delayed-stream still continues to emit all events it captures on the
|
53
|
+
`source`, regardless of whether you have released the delayed stream yet or
|
54
|
+
not.
|
55
|
+
|
56
|
+
Upon creation, delayed-stream captures all `source` events and stores them in
|
57
|
+
an internal event buffer. Once `delayedStream.release()` is called, all
|
58
|
+
buffered events are emitted on the `delayedStream`, and the event buffer is
|
59
|
+
cleared. After that, delayed-stream merely acts as a proxy for the underlaying
|
60
|
+
source.
|
61
|
+
|
62
|
+
### Error handling
|
63
|
+
|
64
|
+
Error events on `source` are buffered / proxied just like any other events.
|
65
|
+
However, `delayedStream.create` attaches a no-op `'error'` listener to the
|
66
|
+
`source`. This way you only have to handle errors on the `delayedStream`
|
67
|
+
object, rather than in two places.
|
68
|
+
|
69
|
+
### Buffer limits
|
70
|
+
|
71
|
+
delayed-stream provides a `maxDataSize` property that can be used to limit
|
72
|
+
the amount of data being buffered. In order to protect you from bad `source`
|
73
|
+
streams that don't react to `source.pause()`, this feature is enabled by
|
74
|
+
default.
|
75
|
+
|
76
|
+
## API
|
77
|
+
|
78
|
+
### DelayedStream.create(source, [options])
|
79
|
+
|
80
|
+
Returns a new `delayedStream`. Available options are:
|
81
|
+
|
82
|
+
* `pauseStream`
|
83
|
+
* `maxDataSize`
|
84
|
+
|
85
|
+
The description for those properties can be found below.
|
86
|
+
|
87
|
+
### delayedStream.source
|
88
|
+
|
89
|
+
The `source` stream managed by this object. This is useful if you are
|
90
|
+
passing your `delayedStream` around, and you still want to access properties
|
91
|
+
on the `source` object.
|
92
|
+
|
93
|
+
### delayedStream.pauseStream = true
|
94
|
+
|
95
|
+
Whether to pause the underlaying `source` when calling
|
96
|
+
`DelayedStream.create()`. Modifying this property afterwards has no effect.
|
97
|
+
|
98
|
+
### delayedStream.maxDataSize = 1024 * 1024
|
99
|
+
|
100
|
+
The amount of data to buffer before emitting an `error`.
|
101
|
+
|
102
|
+
If the underlaying source is emitting `Buffer` objects, the `maxDataSize`
|
103
|
+
refers to bytes.
|
104
|
+
|
105
|
+
If the underlaying source is emitting JavaScript strings, the size refers to
|
106
|
+
characters.
|
107
|
+
|
108
|
+
If you know what you are doing, you can set this property to `Infinity` to
|
109
|
+
disable this feature. You can also modify this property during runtime.
|
110
|
+
|
111
|
+
### delayedStream.dataSize = 0
|
112
|
+
|
113
|
+
The amount of data buffered so far.
|
114
|
+
|
115
|
+
### delayedStream.readable
|
116
|
+
|
117
|
+
An ECMA5 getter that returns the value of `source.readable`.
|
118
|
+
|
119
|
+
### delayedStream.resume()
|
120
|
+
|
121
|
+
If the `delayedStream` has not been released so far, `delayedStream.release()`
|
122
|
+
is called.
|
123
|
+
|
124
|
+
In either case, `source.resume()` is called.
|
125
|
+
|
126
|
+
### delayedStream.pause()
|
127
|
+
|
128
|
+
Calls `source.pause()`.
|
129
|
+
|
130
|
+
### delayedStream.pipe(dest)
|
131
|
+
|
132
|
+
Calls `delayedStream.resume()` and then proxies the arguments to `source.pipe`.
|
133
|
+
|
134
|
+
### delayedStream.release()
|
135
|
+
|
136
|
+
Emits and clears all events that have been buffered up so far. This does not
|
137
|
+
resume the underlaying source, use `delayedStream.resume()` instead.
|
138
|
+
|
139
|
+
## License
|
140
|
+
|
141
|
+
delayed-stream is licensed under the MIT license.
|
@@ -0,0 +1,107 @@
|
|
1
|
+
var Stream = require('stream').Stream;
|
2
|
+
var util = require('util');
|
3
|
+
|
4
|
+
module.exports = DelayedStream;
|
5
|
+
function DelayedStream() {
|
6
|
+
this.source = null;
|
7
|
+
this.dataSize = 0;
|
8
|
+
this.maxDataSize = 1024 * 1024;
|
9
|
+
this.pauseStream = true;
|
10
|
+
|
11
|
+
this._maxDataSizeExceeded = false;
|
12
|
+
this._released = false;
|
13
|
+
this._bufferedEvents = [];
|
14
|
+
}
|
15
|
+
util.inherits(DelayedStream, Stream);
|
16
|
+
|
17
|
+
DelayedStream.create = function(source, options) {
|
18
|
+
var delayedStream = new this();
|
19
|
+
|
20
|
+
options = options || {};
|
21
|
+
for (var option in options) {
|
22
|
+
delayedStream[option] = options[option];
|
23
|
+
}
|
24
|
+
|
25
|
+
delayedStream.source = source;
|
26
|
+
|
27
|
+
var realEmit = source.emit;
|
28
|
+
source.emit = function() {
|
29
|
+
delayedStream._handleEmit(arguments);
|
30
|
+
return realEmit.apply(source, arguments);
|
31
|
+
};
|
32
|
+
|
33
|
+
source.on('error', function() {});
|
34
|
+
if (delayedStream.pauseStream) {
|
35
|
+
source.pause();
|
36
|
+
}
|
37
|
+
|
38
|
+
return delayedStream;
|
39
|
+
};
|
40
|
+
|
41
|
+
Object.defineProperty(DelayedStream.prototype, 'readable', {
|
42
|
+
configurable: true,
|
43
|
+
enumerable: true,
|
44
|
+
get: function() {
|
45
|
+
return this.source.readable;
|
46
|
+
}
|
47
|
+
});
|
48
|
+
|
49
|
+
DelayedStream.prototype.setEncoding = function() {
|
50
|
+
return this.source.setEncoding.apply(this.source, arguments);
|
51
|
+
};
|
52
|
+
|
53
|
+
DelayedStream.prototype.resume = function() {
|
54
|
+
if (!this._released) {
|
55
|
+
this.release();
|
56
|
+
}
|
57
|
+
|
58
|
+
this.source.resume();
|
59
|
+
};
|
60
|
+
|
61
|
+
DelayedStream.prototype.pause = function() {
|
62
|
+
this.source.pause();
|
63
|
+
};
|
64
|
+
|
65
|
+
DelayedStream.prototype.release = function() {
|
66
|
+
this._released = true;
|
67
|
+
|
68
|
+
this._bufferedEvents.forEach(function(args) {
|
69
|
+
this.emit.apply(this, args);
|
70
|
+
}.bind(this));
|
71
|
+
this._bufferedEvents = [];
|
72
|
+
};
|
73
|
+
|
74
|
+
DelayedStream.prototype.pipe = function() {
|
75
|
+
var r = Stream.prototype.pipe.apply(this, arguments);
|
76
|
+
this.resume();
|
77
|
+
return r;
|
78
|
+
};
|
79
|
+
|
80
|
+
DelayedStream.prototype._handleEmit = function(args) {
|
81
|
+
if (this._released) {
|
82
|
+
this.emit.apply(this, args);
|
83
|
+
return;
|
84
|
+
}
|
85
|
+
|
86
|
+
if (args[0] === 'data') {
|
87
|
+
this.dataSize += args[1].length;
|
88
|
+
this._checkIfMaxDataSizeExceeded();
|
89
|
+
}
|
90
|
+
|
91
|
+
this._bufferedEvents.push(args);
|
92
|
+
};
|
93
|
+
|
94
|
+
DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
|
95
|
+
if (this._maxDataSizeExceeded) {
|
96
|
+
return;
|
97
|
+
}
|
98
|
+
|
99
|
+
if (this.dataSize <= this.maxDataSize) {
|
100
|
+
return;
|
101
|
+
}
|
102
|
+
|
103
|
+
this._maxDataSizeExceeded = true;
|
104
|
+
var message =
|
105
|
+
'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'
|
106
|
+
this.emit('error', new Error(message));
|
107
|
+
};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"author": "Felix Geisendörfer <felix@debuggable.com> (http://debuggable.com/)",
|
3
|
+
"contributors": [
|
4
|
+
"Mike Atkins <apeherder@gmail.com>"
|
5
|
+
],
|
6
|
+
"name": "delayed-stream",
|
7
|
+
"description": "Buffers events from a stream until you are ready to handle them.",
|
8
|
+
"license": "MIT",
|
9
|
+
"version": "1.0.0",
|
10
|
+
"homepage": "https://github.com/felixge/node-delayed-stream",
|
11
|
+
"repository": {
|
12
|
+
"type": "git",
|
13
|
+
"url": "git://github.com/felixge/node-delayed-stream.git"
|
14
|
+
},
|
15
|
+
"main": "./lib/delayed_stream",
|
16
|
+
"engines": {
|
17
|
+
"node": ">=0.4.0"
|
18
|
+
},
|
19
|
+
"scripts": {
|
20
|
+
"test": "make test"
|
21
|
+
},
|
22
|
+
"dependencies": {},
|
23
|
+
"devDependencies": {
|
24
|
+
"fake": "0.2.0",
|
25
|
+
"far": "0.0.1"
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Copyright (c) Felix Böhm
|
2
|
+
All rights reserved.
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
5
|
+
|
6
|
+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
7
|
+
|
8
|
+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
9
|
+
|
10
|
+
THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
|
11
|
+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@@ -0,0 +1,211 @@
|
|
1
|
+
import htmlDecodeTree from "./generated/decode-data-html.js";
|
2
|
+
import xmlDecodeTree from "./generated/decode-data-xml.js";
|
3
|
+
import decodeCodePoint from "./decode_codepoint.js";
|
4
|
+
export { htmlDecodeTree, xmlDecodeTree, decodeCodePoint };
|
5
|
+
export { replaceCodePoint, fromCodePoint } from "./decode_codepoint.js";
|
6
|
+
export declare enum BinTrieFlags {
|
7
|
+
VALUE_LENGTH = 49152,
|
8
|
+
BRANCH_LENGTH = 16256,
|
9
|
+
JUMP_TABLE = 127
|
10
|
+
}
|
11
|
+
export declare enum DecodingMode {
|
12
|
+
/** Entities in text nodes that can end with any character. */
|
13
|
+
Legacy = 0,
|
14
|
+
/** Only allow entities terminated with a semicolon. */
|
15
|
+
Strict = 1,
|
16
|
+
/** Entities in attributes have limitations on ending characters. */
|
17
|
+
Attribute = 2
|
18
|
+
}
|
19
|
+
/**
|
20
|
+
* Producers for character reference errors as defined in the HTML spec.
|
21
|
+
*/
|
22
|
+
export interface EntityErrorProducer {
|
23
|
+
missingSemicolonAfterCharacterReference(): void;
|
24
|
+
absenceOfDigitsInNumericCharacterReference(consumedCharacters: number): void;
|
25
|
+
validateNumericCharacterReference(code: number): void;
|
26
|
+
}
|
27
|
+
/**
|
28
|
+
* Token decoder with support of writing partial entities.
|
29
|
+
*/
|
30
|
+
export declare class EntityDecoder {
|
31
|
+
/** The tree used to decode entities. */
|
32
|
+
private readonly decodeTree;
|
33
|
+
/**
|
34
|
+
* The function that is called when a codepoint is decoded.
|
35
|
+
*
|
36
|
+
* For multi-byte named entities, this will be called multiple times,
|
37
|
+
* with the second codepoint, and the same `consumed` value.
|
38
|
+
*
|
39
|
+
* @param codepoint The decoded codepoint.
|
40
|
+
* @param consumed The number of bytes consumed by the decoder.
|
41
|
+
*/
|
42
|
+
private readonly emitCodePoint;
|
43
|
+
/** An object that is used to produce errors. */
|
44
|
+
private readonly errors?;
|
45
|
+
constructor(
|
46
|
+
/** The tree used to decode entities. */
|
47
|
+
decodeTree: Uint16Array,
|
48
|
+
/**
|
49
|
+
* The function that is called when a codepoint is decoded.
|
50
|
+
*
|
51
|
+
* For multi-byte named entities, this will be called multiple times,
|
52
|
+
* with the second codepoint, and the same `consumed` value.
|
53
|
+
*
|
54
|
+
* @param codepoint The decoded codepoint.
|
55
|
+
* @param consumed The number of bytes consumed by the decoder.
|
56
|
+
*/
|
57
|
+
emitCodePoint: (cp: number, consumed: number) => void,
|
58
|
+
/** An object that is used to produce errors. */
|
59
|
+
errors?: EntityErrorProducer | undefined);
|
60
|
+
/** The current state of the decoder. */
|
61
|
+
private state;
|
62
|
+
/** Characters that were consumed while parsing an entity. */
|
63
|
+
private consumed;
|
64
|
+
/**
|
65
|
+
* The result of the entity.
|
66
|
+
*
|
67
|
+
* Either the result index of a numeric entity, or the codepoint of a
|
68
|
+
* numeric entity.
|
69
|
+
*/
|
70
|
+
private result;
|
71
|
+
/** The current index in the decode tree. */
|
72
|
+
private treeIndex;
|
73
|
+
/** The number of characters that were consumed in excess. */
|
74
|
+
private excess;
|
75
|
+
/** The mode in which the decoder is operating. */
|
76
|
+
private decodeMode;
|
77
|
+
/** Resets the instance to make it reusable. */
|
78
|
+
startEntity(decodeMode: DecodingMode): void;
|
79
|
+
/**
|
80
|
+
* Write an entity to the decoder. This can be called multiple times with partial entities.
|
81
|
+
* If the entity is incomplete, the decoder will return -1.
|
82
|
+
*
|
83
|
+
* Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the
|
84
|
+
* entity is incomplete, and resume when the next string is written.
|
85
|
+
*
|
86
|
+
* @param string The string containing the entity (or a continuation of the entity).
|
87
|
+
* @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
|
88
|
+
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
89
|
+
*/
|
90
|
+
write(str: string, offset: number): number;
|
91
|
+
/**
|
92
|
+
* Switches between the numeric decimal and hexadecimal states.
|
93
|
+
*
|
94
|
+
* Equivalent to the `Numeric character reference state` in the HTML spec.
|
95
|
+
*
|
96
|
+
* @param str The string containing the entity (or a continuation of the entity).
|
97
|
+
* @param offset The current offset.
|
98
|
+
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
99
|
+
*/
|
100
|
+
private stateNumericStart;
|
101
|
+
private addToNumericResult;
|
102
|
+
/**
|
103
|
+
* Parses a hexadecimal numeric entity.
|
104
|
+
*
|
105
|
+
* Equivalent to the `Hexademical character reference state` in the HTML spec.
|
106
|
+
*
|
107
|
+
* @param str The string containing the entity (or a continuation of the entity).
|
108
|
+
* @param offset The current offset.
|
109
|
+
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
110
|
+
*/
|
111
|
+
private stateNumericHex;
|
112
|
+
/**
|
113
|
+
* Parses a decimal numeric entity.
|
114
|
+
*
|
115
|
+
* Equivalent to the `Decimal character reference state` in the HTML spec.
|
116
|
+
*
|
117
|
+
* @param str The string containing the entity (or a continuation of the entity).
|
118
|
+
* @param offset The current offset.
|
119
|
+
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
120
|
+
*/
|
121
|
+
private stateNumericDecimal;
|
122
|
+
/**
|
123
|
+
* Validate and emit a numeric entity.
|
124
|
+
*
|
125
|
+
* Implements the logic from the `Hexademical character reference start
|
126
|
+
* state` and `Numeric character reference end state` in the HTML spec.
|
127
|
+
*
|
128
|
+
* @param lastCp The last code point of the entity. Used to see if the
|
129
|
+
* entity was terminated with a semicolon.
|
130
|
+
* @param expectedLength The minimum number of characters that should be
|
131
|
+
* consumed. Used to validate that at least one digit
|
132
|
+
* was consumed.
|
133
|
+
* @returns The number of characters that were consumed.
|
134
|
+
*/
|
135
|
+
private emitNumericEntity;
|
136
|
+
/**
|
137
|
+
* Parses a named entity.
|
138
|
+
*
|
139
|
+
* Equivalent to the `Named character reference state` in the HTML spec.
|
140
|
+
*
|
141
|
+
* @param str The string containing the entity (or a continuation of the entity).
|
142
|
+
* @param offset The current offset.
|
143
|
+
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
144
|
+
*/
|
145
|
+
private stateNamedEntity;
|
146
|
+
/**
|
147
|
+
* Emit a named entity that was not terminated with a semicolon.
|
148
|
+
*
|
149
|
+
* @returns The number of characters consumed.
|
150
|
+
*/
|
151
|
+
private emitNotTerminatedNamedEntity;
|
152
|
+
/**
|
153
|
+
* Emit a named entity.
|
154
|
+
*
|
155
|
+
* @param result The index of the entity in the decode tree.
|
156
|
+
* @param valueLength The number of bytes in the entity.
|
157
|
+
* @param consumed The number of characters consumed.
|
158
|
+
*
|
159
|
+
* @returns The number of characters consumed.
|
160
|
+
*/
|
161
|
+
private emitNamedEntityData;
|
162
|
+
/**
|
163
|
+
* Signal to the parser that the end of the input was reached.
|
164
|
+
*
|
165
|
+
* Remaining data will be emitted and relevant errors will be produced.
|
166
|
+
*
|
167
|
+
* @returns The number of characters consumed.
|
168
|
+
*/
|
169
|
+
end(): number;
|
170
|
+
}
|
171
|
+
/**
|
172
|
+
* Determines the branch of the current node that is taken given the current
|
173
|
+
* character. This function is used to traverse the trie.
|
174
|
+
*
|
175
|
+
* @param decodeTree The trie.
|
176
|
+
* @param current The current node.
|
177
|
+
* @param nodeIdx The index right after the current node and its value.
|
178
|
+
* @param char The current character.
|
179
|
+
* @returns The index of the next node, or -1 if no branch is taken.
|
180
|
+
*/
|
181
|
+
export declare function determineBranch(decodeTree: Uint16Array, current: number, nodeIdx: number, char: number): number;
|
182
|
+
/**
|
183
|
+
* Decodes an HTML string.
|
184
|
+
*
|
185
|
+
* @param str The string to decode.
|
186
|
+
* @param mode The decoding mode.
|
187
|
+
* @returns The decoded string.
|
188
|
+
*/
|
189
|
+
export declare function decodeHTML(str: string, mode?: DecodingMode): string;
|
190
|
+
/**
|
191
|
+
* Decodes an HTML string in an attribute.
|
192
|
+
*
|
193
|
+
* @param str The string to decode.
|
194
|
+
* @returns The decoded string.
|
195
|
+
*/
|
196
|
+
export declare function decodeHTMLAttribute(str: string): string;
|
197
|
+
/**
|
198
|
+
* Decodes an HTML string, requiring all entities to be terminated by a semicolon.
|
199
|
+
*
|
200
|
+
* @param str The string to decode.
|
201
|
+
* @returns The decoded string.
|
202
|
+
*/
|
203
|
+
export declare function decodeHTMLStrict(str: string): string;
|
204
|
+
/**
|
205
|
+
* Decodes an XML string, requiring all entities to be terminated by a semicolon.
|
206
|
+
*
|
207
|
+
* @param str The string to decode.
|
208
|
+
* @returns The decoded string.
|
209
|
+
*/
|
210
|
+
export declare function decodeXML(str: string): string;
|
211
|
+
//# sourceMappingURL=decode.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"decode.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["decode.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,iCAAiC,CAAC;AAC7D,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAC3D,OAAO,eAGN,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAoBxE,oBAAY,YAAY;IACpB,YAAY,QAAwB;IACpC,aAAa,QAAwB;IACrC,UAAU,MAAwB;CACrC;AAuCD,oBAAY,YAAY;IACpB,8DAA8D;IAC9D,MAAM,IAAI;IACV,uDAAuD;IACvD,MAAM,IAAI;IACV,oEAAoE;IACpE,SAAS,IAAI;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,uCAAuC,IAAI,IAAI,CAAC;IAChD,0CAA0C,CACtC,kBAAkB,EAAE,MAAM,GAC3B,IAAI,CAAC;IACR,iCAAiC,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACzD;AAED;;GAEG;AACH,qBAAa,aAAa;IAElB,wCAAwC;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B;;;;;;;;OAQG;IACH,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,gDAAgD;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;;IAbxB,wCAAwC;IACvB,UAAU,EAAE,WAAW;IACxC;;;;;;;;OAQG;IACc,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI;IACtE,gDAAgD;IAC/B,MAAM,CAAC,iCAAqB;IAGjD,wCAAwC;IACxC,OAAO,CAAC,KAAK,CAAkC;IAC/C,6DAA6D;IAC7D,OAAO,CAAC,QAAQ,CAAK;IACrB;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAK;IAEnB,4CAA4C;IAC5C,OAAO,CAAC,SAAS,CAAK;IACtB,6DAA6D;IAC7D,OAAO,CAAC,MAAM,CAAK;IACnB,kDAAkD;IAClD,OAAO,CAAC,UAAU,CAAuB;IAEzC,+CAA+C;IAC/C,WAAW,CAAC,UAAU,EAAE,YAAY,GAAG,IAAI;IAS3C;;;;;;;;;;OAUG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IA8B1C;;;;;;;;OAQG;IACH,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,kBAAkB;IAe1B;;;;;;;;OAQG;IACH,OAAO,CAAC,eAAe;IAkBvB;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;IAkB3B;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,iBAAiB;IA6BzB;;;;;;;;OAQG;IACH,OAAO,CAAC,gBAAgB;IAsDxB;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IAYpC;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;IAqB3B;;;;;;OAMG;IACH,GAAG,IAAI,MAAM;CA6BhB;AAoDD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC3B,UAAU,EAAE,WAAW,EACvB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GACb,MAAM,CAsCR;AAKD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,eAAsB,GAAG,MAAM,CAE1E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C"}
|