Chunte HF staff commited on
Commit
5de1c56
1 Parent(s): ea98194

Upload 1904 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .cache/nix/binary-cache-v6.sqlite +0 -0
  2. .cache/nix/binary-cache-v6.sqlite-journal +0 -0
  3. .cache/replit/__replit_disk_meta.json +1 -0
  4. .cache/replit/modules.stamp +0 -0
  5. .cache/replit/modules/replit_v5-20240209-9e3a339.res +1 -0
  6. .cache/replit/nix/env.json +1 -0
  7. .cache/typescript/4.8/node_modules/types-registry/README.md +2 -0
  8. .cache/typescript/4.8/node_modules/types-registry/index.json +0 -0
  9. .cache/typescript/4.8/node_modules/types-registry/package.json +52 -0
  10. .cache/typescript/4.8/package-lock.json +11 -0
  11. .cache/typescript/4.8/package.json +6 -0
  12. .config/configstore/update-notifier-npm.json +4 -0
  13. .deno/dep_analysis_cache_v1 +0 -0
  14. .deno/dep_analysis_cache_v1-journal +0 -0
  15. .deno/deps/https/deno.land/0b6eb9ee05f05f2c53ace8ddc098d2f61379d98eb03a8cb59d785b67cf4d4f6b +39 -0
  16. .deno/deps/https/deno.land/0b6eb9ee05f05f2c53ace8ddc098d2f61379d98eb03a8cb59d785b67cf4d4f6b.metadata.json +35 -0
  17. .deno/deps/https/deno.land/0ce54a636d537bee3da40798d6ef467c7259312894dd85635945a8d1d0a9ead3 +15 -0
  18. .deno/deps/https/deno.land/0ce54a636d537bee3da40798d6ef467c7259312894dd85635945a8d1d0a9ead3.metadata.json +35 -0
  19. .deno/deps/https/deno.land/169f4312ba164e3f7d36e8ba945c39a3fefff611217384f877c888d77a3c4377 +0 -0
  20. .deno/deps/https/deno.land/169f4312ba164e3f7d36e8ba945c39a3fefff611217384f877c888d77a3c4377.metadata.json +35 -0
  21. .deno/deps/https/deno.land/1987df074c07c15283df07b0e8fbe35900df9fdcc9239a24197559f1f383d1dd +18 -0
  22. .deno/deps/https/deno.land/1987df074c07c15283df07b0e8fbe35900df9fdcc9239a24197559f1f383d1dd.metadata.json +35 -0
  23. .deno/deps/https/deno.land/20000027ca53de11171f2184ab15306a7a99339210f33752521b9ab2bcec30bc +69 -0
  24. .deno/deps/https/deno.land/20000027ca53de11171f2184ab15306a7a99339210f33752521b9ab2bcec30bc.metadata.json +35 -0
  25. .deno/deps/https/deno.land/240abb71b35597950024783a333e95a7489019d12858652d2d75c91020b1a52f +48 -0
  26. .deno/deps/https/deno.land/240abb71b35597950024783a333e95a7489019d12858652d2d75c91020b1a52f.metadata.json +35 -0
  27. .deno/deps/https/deno.land/2458f931dced104bb23594f63096f7a2afa1e78bba99527b6ad35426d516b247 +9 -0
  28. .deno/deps/https/deno.land/2458f931dced104bb23594f63096f7a2afa1e78bba99527b6ad35426d516b247.metadata.json +35 -0
  29. .deno/deps/https/deno.land/2d42e05955049935cf121ad3d14d949da14b4c2ec355b1ac41b8bd233b186fc6 +260 -0
  30. .deno/deps/https/deno.land/2d42e05955049935cf121ad3d14d949da14b4c2ec355b1ac41b8bd233b186fc6.metadata.json +35 -0
  31. .deno/deps/https/deno.land/3b4317ea97e012608910e529127dce91d98e61254b54f99ea91efa07d92b8f44 +3 -0
  32. .deno/deps/https/deno.land/3b4317ea97e012608910e529127dce91d98e61254b54f99ea91efa07d92b8f44.metadata.json +35 -0
  33. .deno/deps/https/deno.land/4e07f5fc21ab1b67b23874d4aec7875cfe6150e248d2e7676c7fad62ad05152b +1002 -0
  34. .deno/deps/https/deno.land/4e07f5fc21ab1b67b23874d4aec7875cfe6150e248d2e7676c7fad62ad05152b.metadata.json +35 -0
  35. .deno/deps/https/deno.land/59e46148ccca57c14d2755561933862de4647177b1493b50d6963147427f5e11 +504 -0
  36. .deno/deps/https/deno.land/59e46148ccca57c14d2755561933862de4647177b1493b50d6963147427f5e11.metadata.json +35 -0
  37. .deno/deps/https/deno.land/678a5cff2d17fd224e1703f305e09ac8a2328bb71302e03665dcd871eb41c428 +387 -0
  38. .deno/deps/https/deno.land/678a5cff2d17fd224e1703f305e09ac8a2328bb71302e03665dcd871eb41c428.metadata.json +35 -0
  39. .deno/deps/https/deno.land/68c0328e6ee41a9088cacf7c7ec358c0b7e757cf39291f2273f4b8d7950e2185 +381 -0
  40. .deno/deps/https/deno.land/68c0328e6ee41a9088cacf7c7ec358c0b7e757cf39291f2273f4b8d7950e2185.metadata.json +35 -0
  41. .deno/deps/https/deno.land/6b53dbda29cf8186bf78dc67d9f2b44c60d22f4d20d66dccce32493e9c631b18 +720 -0
  42. .deno/deps/https/deno.land/6b53dbda29cf8186bf78dc67d9f2b44c60d22f4d20d66dccce32493e9c631b18.metadata.json +35 -0
  43. .deno/deps/https/deno.land/79fa3fa51a04a2aa15ce1e2f8f6d15c1b792c62ecec496f3f23b9f0042f45156 +15 -0
  44. .deno/deps/https/deno.land/79fa3fa51a04a2aa15ce1e2f8f6d15c1b792c62ecec496f3f23b9f0042f45156.metadata.json +35 -0
  45. .deno/deps/https/deno.land/7c84f0bf5dd8c48257088f96cefebf3520889c2938e74ef31eb5ca0ed3398b6e +132 -0
  46. .deno/deps/https/deno.land/7c84f0bf5dd8c48257088f96cefebf3520889c2938e74ef31eb5ca0ed3398b6e.metadata.json +35 -0
  47. .deno/deps/https/deno.land/7f0ddf903842574b2a331f7a10a8601cc3b6930a32846329b7c607402db08f1b +153 -0
  48. .deno/deps/https/deno.land/7f0ddf903842574b2a331f7a10a8601cc3b6930a32846329b7c607402db08f1b.metadata.json +35 -0
  49. .deno/deps/https/deno.land/7fafc2af7ec45b2c2974a99211673659bce419c1811d4c7d030f7d8ffd7bcc19 +39 -0
  50. .deno/deps/https/deno.land/7fafc2af7ec45b2c2974a99211673659bce419c1811d4c7d030f7d8ffd7bcc19.metadata.json +35 -0
.cache/nix/binary-cache-v6.sqlite ADDED
Binary file (41 kB). View file
 
.cache/nix/binary-cache-v6.sqlite-journal ADDED
File without changes
.cache/replit/__replit_disk_meta.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"nonce":4509958721781262117,"last_updated":{"seconds":1699143476,"nanos":34568000}}
.cache/replit/modules.stamp ADDED
File without changes
.cache/replit/modules/replit_v5-20240209-9e3a339.res ADDED
@@ -0,0 +1 @@
 
 
1
+ {"type":"resolve","resolvedModuleId":"replit:v5-20240209-9e3a339","inputHash":"","resolutionPath":["replit","replit:v1-20231211-d5ddcff","replit:v2-20240117-0bd73cd","replit:v3-20240123-c72e35a","replit:v4-20240206-fdbd396","replit:v5-20240209-9e3a339"],"error":"","Changed":true}
.cache/replit/nix/env.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"entries":{"replit.nix":{"env":{"AR":"ar","AS":"as","CC":"gcc","CONFIG_SHELL":"/nix/store/dsd5gz46hdbdk2rfdimqddhq6m8m8fqs-bash-5.1-p16/bin/bash","CXX":"g++","HOST_PATH":"/nix/store/0l5yh0rdzibk8arj9c8gzy1570jkc3vf-nodejs-16.18.1/bin:/nix/store/w8q2bwi6rdhsa1dz9i8mqznddk5l7p26-typescript-language-server-3.3.2/bin:/nix/store/zdcnqq55qi214j46zgw2qa1jp4dpdf2m-yarn-1.22.19/bin:/nix/store/n1wjpwirjdkvkqyfjjg8qafgdhpr5w2m-jest-cli-23.6.0/bin:/nix/store/a7gvj343m05j2s32xcnwr35v31ynlypr-coreutils-9.1/bin:/nix/store/mydc6f4k2z73xlcz7ilif3v2lcaiqvza-findutils-4.9.0/bin:/nix/store/j9p3g8472iijd50vhdprx0nmk2fqn5gv-diffutils-3.8/bin:/nix/store/89zs7rms6x00xfq4dq6m7mjnhkr8a6r4-gnused-4.8/bin:/nix/store/86bp03jkmsl6f92w0yzg4s59g5mhxwmy-gnugrep-3.7/bin:/nix/store/hwcdqw4jrjnd37wxqgsd47hd0j8bnj09-gawk-5.1.1/bin:/nix/store/cfbhw8r8ags41vwqaz47r583d0p4h4a1-gnutar-1.34/bin:/nix/store/p3m1ndl1lapwrlh698bnb5lvvxh67378-gzip-1.12/bin:/nix/store/a8mhcagrsly7c7mpjrpsnaahk4aax056-bzip2-1.0.8-bin/bin:/nix/store/mblgz65m3zv9x548a3d5m96fj2pbwr09-gnumake-4.3/bin:/nix/store/dsd5gz46hdbdk2rfdimqddhq6m8m8fqs-bash-5.1-p16/bin:/nix/store/v7ljksji50mg3w61dykaa3n3y79n6nil-patch-2.7.6/bin:/nix/store/zlcnmqq14jz5x9439jf937mvayyl63da-xz-5.2.7-bin/bin:/nix/store/y6aj732zm9m87c82fpvf103a1xb22blp-file-5.43/bin","LD":"ld","LD_LIBRARY_PATH":"/nix/store/q4hrphx851xvkcnyyvqqyf1yjgmkmiar-mesa-22.2.3-drivers/lib:/nix/store/cxhib72pd7n3fzl1yh6lrm4q16l42kws-libglvnd-1.5.0/lib:/nix/store/bvihhgw8bh6cqqlj0d4s8cvmm4mqmzfc-pulseaudio-16.1/lib","LIBGL_DRIVERS_PATH":"/nix/store/q4hrphx851xvkcnyyvqqyf1yjgmkmiar-mesa-22.2.3-drivers/lib/dri","LOCALE_ARCHIVE":"/usr/lib/locale/locale-archive","NIX_BINTOOLS":"/nix/store/1d6ian3r8kdzspw8hacjhl3xkp40g1lj-binutils-wrapper-2.39","NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu":"1","NIX_BUILD_CORES":"1","NIX_BUILD_TOP":"/tmp","NIX_CC":"/nix/store/dq0xwmsk1g0i2ayg6pb7y87na2knzylh-gcc-wrapper-11.3.0","NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu":"1","NIX_CFLAGS_COMPILE":" -frandom-seed=1i84iccb7a -isystem /nix/store/0l5yh0rdzibk8arj9c8gzy1570jkc3vf-nodejs-16.18.1/include -isystem /nix/store/0l5yh0rdzibk8arj9c8gzy1570jkc3vf-nodejs-16.18.1/include","NIX_ENFORCE_NO_NATIVE":"1","NIX_HARDENING_ENABLE":"fortify stackprotector pic strictoverflow format relro bindnow","NIX_INDENT_MAKE":"1","NIX_LDFLAGS":"-rpath /nix/store/1i84iccb7aypxiyzk5pgbni88566v3ly-nix-shell/lib64 -rpath /nix/store/1i84iccb7aypxiyzk5pgbni88566v3ly-nix-shell/lib ","NIX_STORE":"/nix/store","NM":"nm","NODE_PATH":"/nix/store/0l5yh0rdzibk8arj9c8gzy1570jkc3vf-nodejs-16.18.1/lib/node_modules:/nix/store/w8q2bwi6rdhsa1dz9i8mqznddk5l7p26-typescript-language-server-3.3.2/lib/node_modules:/nix/store/n1wjpwirjdkvkqyfjjg8qafgdhpr5w2m-jest-cli-23.6.0/lib/node_modules","OBJCOPY":"objcopy","OBJDUMP":"objdump","PATH":"/nix/store/bap4d0lpcrhpwmpb8ayjcgkmvfj62lnq-bash-interactive-5.1-p16/bin:/nix/store/pr5n59mb4jzmfx6kanwxly0l07p861fg-patchelf-0.15.0/bin:/nix/store/dq0xwmsk1g0i2ayg6pb7y87na2knzylh-gcc-wrapper-11.3.0/bin:/nix/store/1gf2flfqnpqbr1b4p4qz2f72y42bs56r-gcc-11.3.0/bin:/nix/store/57xv61c5zi8pphjbcwxxjlgc34p61ic9-glibc-2.35-163-bin/bin:/nix/store/a7gvj343m05j2s32xcnwr35v31ynlypr-coreutils-9.1/bin:/nix/store/1d6ian3r8kdzspw8hacjhl3xkp40g1lj-binutils-wrapper-2.39/bin:/nix/store/039g378vc3pc3dvi9dzdlrd0i4q93qwf-binutils-2.39/bin:/nix/store/0l5yh0rdzibk8arj9c8gzy1570jkc3vf-nodejs-16.18.1/bin:/nix/store/w8q2bwi6rdhsa1dz9i8mqznddk5l7p26-typescript-language-server-3.3.2/bin:/nix/store/zdcnqq55qi214j46zgw2qa1jp4dpdf2m-yarn-1.22.19/bin:/nix/store/n1wjpwirjdkvkqyfjjg8qafgdhpr5w2m-jest-cli-23.6.0/bin:/nix/store/a7gvj343m05j2s32xcnwr35v31ynlypr-coreutils-9.1/bin:/nix/store/mydc6f4k2z73xlcz7ilif3v2lcaiqvza-findutils-4.9.0/bin:/nix/store/j9p3g8472iijd50vhdprx0nmk2fqn5gv-diffutils-3.8/bin:/nix/store/89zs7rms6x00xfq4dq6m7mjnhkr8a6r4-gnused-4.8/bin:/nix/store/86bp03jkmsl6f92w0yzg4s59g5mhxwmy-gnugrep-3.7/bin:/nix/store/hwcdqw4jrjnd37wxqgsd47hd0j8bnj09-gawk-5.1.1/bin:/nix/store/cfbhw8r8ags41vwqaz47r583d0p4h4a1-gnutar-1.34/bin:/nix/store/p3m1ndl1lapwrlh698bnb5lvvxh67378-gzip-1.12/bin:/nix/store/a8mhcagrsly7c7mpjrpsnaahk4aax056-bzip2-1.0.8-bin/bin:/nix/store/mblgz65m3zv9x548a3d5m96fj2pbwr09-gnumake-4.3/bin:/nix/store/dsd5gz46hdbdk2rfdimqddhq6m8m8fqs-bash-5.1-p16/bin:/nix/store/v7ljksji50mg3w61dykaa3n3y79n6nil-patch-2.7.6/bin:/nix/store/zlcnmqq14jz5x9439jf937mvayyl63da-xz-5.2.7-bin/bin:/nix/store/y6aj732zm9m87c82fpvf103a1xb22blp-file-5.43/bin","RANLIB":"ranlib","READELF":"readelf","REPLIT_LD_LIBRARY_PATH":"/nix/store/0l5yh0rdzibk8arj9c8gzy1570jkc3vf-nodejs-16.18.1/lib:/nix/store/w8q2bwi6rdhsa1dz9i8mqznddk5l7p26-typescript-language-server-3.3.2/lib:/nix/store/n1wjpwirjdkvkqyfjjg8qafgdhpr5w2m-jest-cli-23.6.0/lib","SIZE":"size","SOURCE_DATE_EPOCH":"315532800","STRINGS":"strings","STRIP":"strip","XDG_DATA_DIRS":"/nix/store/pr5n59mb4jzmfx6kanwxly0l07p861fg-patchelf-0.15.0/share","_":"/nix/store/a7gvj343m05j2s32xcnwr35v31ynlypr-coreutils-9.1/bin/env","__EGL_VENDOR_LIBRARY_FILENAMES":"/nix/store/q4hrphx851xvkcnyyvqqyf1yjgmkmiar-mesa-22.2.3-drivers/share/glvnd/egl_vendor.d/50_mesa.json","__ETC_PROFILE_SOURCED":"1","buildInputs":"/nix/store/0l5yh0rdzibk8arj9c8gzy1570jkc3vf-nodejs-16.18.1 /nix/store/w8q2bwi6rdhsa1dz9i8mqznddk5l7p26-typescript-language-server-3.3.2 /nix/store/zdcnqq55qi214j46zgw2qa1jp4dpdf2m-yarn-1.22.19 /nix/store/n1wjpwirjdkvkqyfjjg8qafgdhpr5w2m-jest-cli-23.6.0","buildPhase":"echo \"------------------------------------------------------------\" \u003e\u003e$out\necho \" WARNING: the existence of this path is not guaranteed.\" \u003e\u003e$out\necho \" It is an internal implementation detail for pkgs.mkShell.\" \u003e\u003e$out\necho \"------------------------------------------------------------\" \u003e\u003e$out\necho \u003e\u003e $out\n# Record all build inputs as runtime dependencies\nexport \u003e\u003e $out\n","builder":"/nix/store/dsd5gz46hdbdk2rfdimqddhq6m8m8fqs-bash-5.1-p16/bin/bash","cmakeFlags":"","configureFlags":"","depsBuildBuild":"","depsBuildBuildPropagated":"","depsBuildTarget":"","depsBuildTargetPropagated":"","depsHostHost":"","depsHostHostPropagated":"","depsTargetTarget":"","depsTargetTargetPropagated":"","doCheck":"","doInstallCheck":"","mesonFlags":"","name":"nix-shell","nativeBuildInputs":"","out":"/nix/store/1i84iccb7aypxiyzk5pgbni88566v3ly-nix-shell","outputs":"out","patches":"","phases":"buildPhase","propagatedBuildInputs":"","propagatedNativeBuildInputs":"","shell":"/nix/store/dsd5gz46hdbdk2rfdimqddhq6m8m8fqs-bash-5.1-p16/bin/bash","shellHook":"","stdenv":"/nix/store/kmfaajdpyyyg319vfqni5jm9wkxjmf73-stdenv-linux","strictDeps":"","system":"x86_64-linux"},"dependencies":[{"path":"replit.nix","mod_time":"2024-02-22T20:14:14.504363299Z"}],"closure":["/nix/store/34xlpp3j3vy7ksn09zh44f1c04w77khf-libunistring-1.0","/nix/store/5mh5019jigj0k14rdnjam1xwk5avn1id-libidn2-2.3.2","/nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163","/nix/store/026hln0aq1hyshaxsdvhg0kmcm6yf45r-zlib-1.2.13","/nix/store/mdck89nsfisflwjv6xv8ydj7dj0sj2pn-gcc-11.3.0-lib","/nix/store/039g378vc3pc3dvi9dzdlrd0i4q93qwf-binutils-2.39","/nix/store/9ad850yxw6jfvf3l3dbvp8dh2a3g4j71-libgpg-error-1.45","/nix/store/073j1x6mc31pz9hff2a1nb423kmkl3ii-libassuan-2.5.5","/nix/store/09gxmx43bc0snqc2hf094hnxpx2bb4hh-libXdmcp-1.1.3","/nix/store/57xv61c5zi8pphjbcwxxjlgc34p61ic9-glibc-2.35-163-bin","/nix/store/09gyxf17hs4hkpgnbj1kdz8xk5c3w4mm-getent-glibc-2.35-163","/nix/store/4mxnw95jcm5a27qk60z7yc0gvxp42b9a-openssl-3.0.7","/nix/store/75dl24qd9yvigjkndfqjkhlbwq8i2q87-libcbor-0.9.0","/nix/store/cr5fmwri3601s7724ayjvckhsg6cz4rv-attr-2.5.1","/nix/store/7q41sbf04qcwv75j5bxis6pfjnmshy44-acl-2.3.1","/nix/store/w10in9diaqrcqqxi5lg20n3q2jfpk6pq-zstd-1.5.2","/nix/store/w3sdhqiazzp4iy40wc2g85mv0grg1cx0-xz-5.2.7","/nix/store/86yrrihrf5ghfvrh3j087zhpc9iajsmh-kmod-30-lib","/nix/store/9izprbjfnlk2dn9sqp9af9nci6zncx2l-kexec-tools-2.0.25","/nix/store/lgdq362bvrzc4bg0cb8mj38rsjcmzxsf-gmp-with-cxx-stage4-6.2.1","/nix/store/a7gvj343m05j2s32xcnwr35v31ynlypr-coreutils-9.1","/nix/store/acvafmp652dj67f4g3sdx68n2mg1afz4-util-linux-minimal-2.38.1-lib","/nix/store/dsd5gz46hdbdk2rfdimqddhq6m8m8fqs-bash-5.1-p16","/nix/store/b09kqza5nw7y2jpvb6q4dz9hixrm0ipk-db-4.8.30","/nix/store/mhcgwcc7r208pnwv5j26j58iqvl1yvqj-audit-2.8.5","/nix/store/xf0ssp8s6xjz710q33hspj5dphqhmmc1-libxcrypt-4.4.30","/nix/store/hk0qw5ynzy1h7w4vn4bg6hwirf2a2y56-linux-pam-1.5.2","/nix/store/c7klanhckqpsvv4x2izcyzvfb8vazy4s-shadow-4.11.1","/nix/store/jv63bkng8b3y1zw0qsjrpwz2gsibll82-libcap-ng-0.8.3","/nix/store/asixagjq1jfkbmgi1600j23v394sr58a-util-linux-minimal-2.38.1-bin","/nix/store/1i5ah27gxx3a3fyjyydfwwzqq8ni33i8-ncurses-6.3-p20220507","/nix/store/5gkbi9cfq8hddrfzzjdpvhrw8fsp5xsl-readline-8.1p2","/nix/store/bap4d0lpcrhpwmpb8ayjcgkmvfj62lnq-bash-interactive-5.1-p16","/nix/store/c8byvs0rj8vg5cpm5mswcg5dvp7d5ir7-libseccomp-2.5.4-lib","/nix/store/inhqw7zx59hxa0r9am0kw3ip88hpbbrw-kmod-30","/nix/store/jijvvmbza698qa6yjgr1ndgdgyryvq1i-libcap-2.66-lib","/nix/store/ysl6qj5r7nn63b16954dhk7x47r5yq7i-bzip2-1.0.8","/nix/store/a8mhcagrsly7c7mpjrpsnaahk4aax056-bzip2-1.0.8-bin","/nix/store/1dgws25664p544znpc6f1nh9xmjf4ykc-pcre-8.45","/nix/store/86bp03jkmsl6f92w0yzg4s59g5mhxwmy-gnugrep-3.7","/nix/store/mb0pcxkmrg0f6k0zaywlnvpk9q3j5ans-zstd-1.5.2-bin","/nix/store/p3m1ndl1lapwrlh698bnb5lvvxh67378-gzip-1.12","/nix/store/zlcnmqq14jz5x9439jf937mvayyl63da-xz-5.2.7-bin","/nix/store/qmp028x2h8k1i032w88h2lhbylfpi1wj-kbd-2.5.1","/nix/store/adnxnv29s3nnrxrv19z5jnqzww0jd1aa-systemd-minimal-251.7","/nix/store/dfxf2gqizhb1gk1p3qv7jgl9gnlqdaf5-pcsclite-1.9.5","/nix/store/0g989zr25nvqrxdbxbwpzdfc1r6f7m9z-libfido2-1.12.0","/nix/store/974czghvkyg72giyf1lcy76f5zl6dgkh-libogg-1.3.5","/nix/store/0ijjp3ff50ahanz7190syxavgjslbb1r-flac-1.4.2","/nix/store/0y971q54v6jm9ss243xhl4y0gnlsm9c8-zlib-1.2.13-dev","/nix/store/36xp94y7564gc5p6miyddg6xn9bi6pp0-libuv-1.44.2","/nix/store/r3x96j3kmcs8dv4l02rrjmbhm535jycy-icu4c-72.1","/nix/store/7xqm5wfm4djpspmdgj36ijnql31id8xg-icu4c-72.1-dev","/nix/store/1zlrx8g7xs6ar0ggca4h3p6hmapq2p2h-perl-5.36.0","/nix/store/fq47cv26nb87hwz2678r6i8ym5b57lwf-openssl-3.0.7-bin","/nix/store/f95kxwhnr2bazy7nl6wzwjiak02dlp9v-openssl-3.0.7-dev","/nix/store/2217a7zw3rdwx96xn9kcjwlcxkhn9qf8-gdbm-1.23","/nix/store/4lkjvagv0bqq58qpysfabw66rqrbddgb-expat-2.5.0","/nix/store/5aspvhbacf0knl5yyf0x3cs25inxh016-readline-6.3p08","/nix/store/i16lgq16av602nfyws3ps8dd9yj36dwh-tzdata-2022f","/nix/store/jpj9lx0p2h1vs3gkzj8jh350113bsm84-sqlite-3.39.4","/nix/store/pplp2i09gc4k67a4aayr78a4c04jbqxa-mailcap-2.1.53","/nix/store/xghl0l2f6byzqvy06ana2y4isqwa7blw-libffi-3.4.4","/nix/store/zdba9frlxj2ba8ca095win3nphsiiqhb-python3-3.10.8","/nix/store/0l5yh0rdzibk8arj9c8gzy1570jkc3vf-nodejs-16.18.1","/nix/store/46fw6pyn1zs9y0fwfdbgn4363ill17g9-elfutils-0.188","/nix/store/0snlk51mis3zacmva8lpkd462ck831wh-libbpf-1.0.1","/nix/store/i38jcxrwa4fxk2b7acxircpi399kyixw-linux-headers-6.0","/nix/store/4pqv2mwdn88h7xvsm7a5zplrd8sxzvw0-glibc-2.35-163-dev","/nix/store/a1ad8qiqqb9fpg5a9rhlkm44s02sr61p-expand-response-params","/nix/store/1d6ian3r8kdzspw8hacjhl3xkp40g1lj-binutils-wrapper-2.39","/nix/store/1gf2flfqnpqbr1b4p4qz2f72y42bs56r-gcc-11.3.0","/nix/store/1i5y55x4b4m9qkx5dqbmr1r6bvrqbanw-multiple-outputs.sh","/nix/store/6z3agp6jqqdrnrdlsgzbdgw56z8azgr9-npth-1.6","/nix/store/fbd2zvpx1iyisqmq5hn3hdnqs03ycz57-libgcrypt-1.10.1","/nix/store/1nwdvd4bkac2g3a3sd84qbfi4mf07l3y-gnupg-2.3.7","/nix/store/cjdm2inq3madwqpnnddi59vv5yd89m52-pcre2-10.40","/nix/store/ii8xgfqglbvvaiv4isqpy0s7lhqgxrmy-libselinux-3.3","/nix/store/2k366jrbsra97gjfxwvrhvixjfxdach5-glib-2.74.1","/nix/store/2rgwrp4zwia0ayhhxzw000cnjvr51pxa-lz4-1.9.4","/nix/store/2w5ssck8y4kfcpj2argg0kmaw32ii275-dconf-0.40.0-lib","/nix/store/3s1pgzk4acxn7rl6l8z2390w70426yb2-lvm2-2.03.16-lib","/nix/store/59jmzisg8fkm9c125fw384dqq1np602l-move-docs.sh","/nix/store/5bi6hkakf48r8j1nhmhmgbqpij5ka597-sbc-1.4","/nix/store/9krlzvny65gdc8s7kpb6lkx8cd02c25b-default-builder.sh","/nix/store/94gdvbv86cifg62hblk0397n5x7pb03l-libtool-2.4.7-lib","/nix/store/dj1c4rx8ly8kw6i614plql6vm8595pjq-libasyncns-0.8","/nix/store/h3h96j064p5kdjyw48j80005y99j5rcg-soxr-0.1.3","/nix/store/904r2fg24xhnxq7511lqnjy06si0h5j9-libapparmor-3.1.2","/nix/store/cfbhw8r8ags41vwqaz47r583d0p4h4a1-gnutar-1.34","/nix/store/ayr7k5an06pnhpgw2a7zdhvnqzb3chsh-json-c-0.16","/nix/store/g1l4jwmlmab794rb5b3ch3xf0d1168mq-cryptsetup-2.5.0","/nix/store/cph87856yzakak001w00ck5n5cdajl19-libevent-2.1.12","/nix/store/ijz81p08bp812q2bvv77lz9qpfzncibd-gmp-with-cxx-6.2.1","/nix/store/raz5jjjszg123qlmx07dv0w5zjqf2x3y-nettle-3.8.1","/nix/store/gigp6hvw7vn3576dipp0wlkmpp8szs85-unbound-1.17.0-lib","/nix/store/vzrbz3lvmiziy3i79rzmk01wfprhwjh0-libtasn1-4.19.0","/nix/store/h6hww2m19vbc93n6511zvhd810cql278-p11-kit-0.24.1","/nix/store/nsk5b96rl1imwvwpqnkxmqkh0bk9m2dm-dns-root-data-2019-01-11","/nix/store/mq9jfv5yzjr626nszc429pkbg6qc22wa-gnutls-3.7.8","/nix/store/jbvsz76svifygzvvvpi3s6q1zd85b009-libmicrohttpd-0.9.71","/nix/store/cdrs17s1dbdzv0giqvm2lzvxkwrwl6k2-libpcap-1.10.1","/nix/store/idfq8lh60m316bs1958bs1lxffcjxbjm-libnfnetlink-1.0.2","/nix/store/np5midk4wz7xpmwcp4h6ina1jgxwn92h-libmnl-1.0.5","/nix/store/d24wnh2mgf5v70pb7y1yqhx9vjxzdii7-libnetfilter_conntrack-1.0.9","/nix/store/iicq4q8n5adnylc3lixlsmfkznx8h3cr-libnftnl-1.2.4","/nix/store/lq1i7dylhdza29yfpjgvkzfrbpjm4w00-iptables-1.8.8","/nix/store/9iy1ng7h1l6jdmjk157jra8n4hkrfdj1-brotli-1.0.9-lib","/nix/store/qz400bwshaqikj5s2qyvh0c9qffgmqik-nghttp2-1.49.0-lib","/nix/store/816qwr4xy058451rbxr0ccyh1v1akhb6-keyutils-1.6.3-lib","/nix/store/r7gl900my2fw6k33nxh2r7rzv8nv0s25-libkrb5-1.20","/nix/store/vqq9s0d6fw6kqf3sr5nrzqbys9rhygqd-libssh2-1.10.0","/nix/store/rirzp6ijbcwnxlf0b2n286n587r3z9jw-curl-7.86.0","/nix/store/mbyb9f7k47bisn5y2ga3srda4sasi8yi-tpm2-tss-3.2.0","/nix/store/hlf86vmyh14scxwann44fy3azvc6njaj-systemd-251.7","/nix/store/vhw80flmxy6d7xpqs1h56k629xsmmasz-gfortran-11.3.0-lib","/nix/store/lgx9ccic6miz2wrbjhyw6gzbz12rf0pj-fftw-single-3.3.10","/nix/store/kdd3flb0zgiy336sja4ic8lmrpdl5xr7-speexdsp-1.2.1","/nix/store/g6k7s2waqvz6b4bsj4v3ypb9kf12bhd8-alsa-ucm-conf-1.2.7.1","/nix/store/rrwf2b4dhpigs3mvc6z3nsnlzm0qccmq-alsa-topology-conf-1.2.5.1","/nix/store/l3m7axrj699nx4j024sb0dw0215alsd1-alsa-lib-1.2.7.2","/nix/store/k3k6jmzxfjq1s3la01ffpjv2blqd66lk-libvorbis-1.3.7","/nix/store/kzkg5g476xkdh2xwd27ylmlww4phznmv-libopus-1.3.1","/nix/store/njswbyisabvgk02vi4v22yd1lwl80m7r-libsndfile-1.1.0","/nix/store/srqyvqyr1cp5r192xq8vvg2y694w1vyv-webrtc-audio-processing-0.3.1","/nix/store/8ypkjcki98cwblzc4k0kblxz2zpjqj45-libXau-1.0.9","/nix/store/xs3v53gpwwpz34aj5h51rz4wxmjfrf08-libxcb-1.14","/nix/store/w3zzhfl4a7xp0xfflz2gawv02y8ba9z8-libX11-1.8.1","/nix/store/y1ffp4g3yl0ijwdl8lgh4hhq3wl8frcc-dbus-1.14.4-lib","/nix/store/bvihhgw8bh6cqqlj0d4s8cvmm4mqmzfc-pulseaudio-16.1","/nix/store/qvvaq9p7lw05r7szvsx3c17ca5x8h982-libXext-1.3.4","/nix/store/cxhib72pd7n3fzl1yh6lrm4q16l42kws-libglvnd-1.5.0","/nix/store/89zs7rms6x00xfq4dq6m7mjnhkr8a6r4-gnused-4.8","/nix/store/8zxndz5ag0p6s526c2xyllhk1nrn4c3i-audit-tmpdir.sh","/nix/store/bnj8d7mvbkg3vdb07yz74yhl3g107qq5-patch-shebangs.sh","/nix/store/c8n9kcdddp9np665xz6ri61b383nxvz8-move-systemd-user-units.sh","/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh","/nix/store/dq0xwmsk1g0i2ayg6pb7y87na2knzylh-gcc-wrapper-11.3.0","/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh","/nix/store/g8xg0i02aqwhgxwd2vnp5ax3d6lrkg1v-strip.sh","/nix/store/hwcdqw4jrjnd37wxqgsd47hd0j8bnj09-gawk-5.1.1","/nix/store/j9p3g8472iijd50vhdprx0nmk2fqn5gv-diffutils-3.8","/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh","/nix/store/kxw6q8v6isaqjm702d71n2421cxamq68-make-symlinks-relative.sh","/nix/store/m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh","/nix/store/mblgz65m3zv9x548a3d5m96fj2pbwr09-gnumake-4.3","/nix/store/mydc6f4k2z73xlcz7ilif3v2lcaiqvza-findutils-4.9.0","/nix/store/ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh","/nix/store/pr5n59mb4jzmfx6kanwxly0l07p861fg-patchelf-0.15.0","/nix/store/xwl6y60ffijfbhxb754dlxk3pkjgw0d2-ed-1.18","/nix/store/v7ljksji50mg3w61dykaa3n3y79n6nil-patch-2.7.6","/nix/store/wlwcf1nw2b21m4gghj70hbg1v7x53ld8-reproducible-builds.sh","/nix/store/y6aj732zm9m87c82fpvf103a1xb22blp-file-5.43","/nix/store/kmfaajdpyyyg319vfqni5jm9wkxjmf73-stdenv-linux","/nix/store/fzb7khbic8vpcr3m69v6y8qp6jqspdgw-openssl-1.1.1s","/nix/store/9zdxd9grnspixp6iaz7h6564ja550i0q-openssl-1.1.1s-bin","/nix/store/p9zk4lm1902mi3r30kg6fjlmqjay5y8q-openssl-1.1.1s-dev","/nix/store/ii9hqvfq3g2vnsybi1vly9s1j9jcna9k-nodejs-14.21.1","/nix/store/n1wjpwirjdkvkqyfjjg8qafgdhpr5w2m-jest-cli-23.6.0","/nix/store/7sqa8vdyvc3vwh2bq3q7c2kcx1k83iij-libxshmfence-1.3","/nix/store/8gx2zdbvdlhayh3g7006dxipx91rggnh-libelf-0.8.13","/nix/store/h5slhj7gqpqh5q4jb00xdbcwbl8vqqa7-libxml2-2.10.3","/nix/store/8q73rj23w9dms6mq2nwijxsj2lqcmz0r-llvm-14.0.6-lib","/nix/store/cggynsnj7dyk2sxnrr20jvpwcqdiv42f-libpciaccess-0.16","/nix/store/hr321ph174h3whvlvbc0lk5w1n1ljkx7-libdrm-2.4.113","/nix/store/l3y9k2x7cqzcjj9s18z7la9xqsjq6r52-wayland-1.21.0","/nix/store/bk62iwpqiaipgbim564f7zy6prdwpvri-mesa-22.2.3","/nix/store/cr7ldrd6xlq4rgqr99yygy43f77zdk1x-libXfixes-6.0.0","/nix/store/l2p6ikb5wqjcsfnmgcfxmbzi22smr5qa-libXxf86vm-1.1.4","/nix/store/q4hrphx851xvkcnyyvqqyf1yjgmkmiar-mesa-22.2.3-drivers","/nix/store/dj805sw07vvpbxx39c8g67x8qddg0ikw-nodejs-18.12.1","/nix/store/6w8n8fy21yjssg8b1dqkds8diad3v75g-typescript-4.8.4","/nix/store/w8q2bwi6rdhsa1dz9i8mqznddk5l7p26-typescript-language-server-3.3.2","/nix/store/zdcnqq55qi214j46zgw2qa1jp4dpdf2m-yarn-1.22.19","/nix/store/5df7d1vpwcks6l7mnbbqlikvdap97nvp-nix-shell"],"channel":"stable-22_11","channel_nix_path":"/nix/store/2jabpzcs368xsjj6swbhb317z5b6zzyw-nixpkgs-stable-22_11-22.11.tar.gz/nixpkgs-stable-22_11","production":null}}}
.cache/typescript/4.8/node_modules/types-registry/README.md ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ This package contains a listing of all packages published to the @types scope on NPM.
2
+ Generated by [types-publisher](https://github.com/microsoft/DefinitelyTyped-tools/tree/main/packages/publisher#readme).
.cache/typescript/4.8/node_modules/types-registry/index.json ADDED
The diff for this file is too large to render. See raw diff
 
.cache/typescript/4.8/node_modules/types-registry/package.json ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from": "types-registry@latest",
3
+ "_id": "types-registry@0.1.684",
4
+ "_inBundle": false,
5
+ "_integrity": "sha512-B6v+g9M+7IJSc1w2THOmTuRKvd/ACxZTGXM18E8MzpHWx1mGUvGGT+RXsSnxNpyqtbjWLeXj8uyyu/MxVOS3xw==",
6
+ "_location": "/types-registry",
7
+ "_phantomChildren": {},
8
+ "_requested": {
9
+ "type": "tag",
10
+ "registry": true,
11
+ "raw": "types-registry@latest",
12
+ "name": "types-registry",
13
+ "escapedName": "types-registry",
14
+ "rawSpec": "latest",
15
+ "saveSpec": null,
16
+ "fetchSpec": "latest"
17
+ },
18
+ "_requiredBy": [
19
+ "#USER",
20
+ "/"
21
+ ],
22
+ "_resolved": "https://registry.npmjs.org/types-registry/-/types-registry-0.1.684.tgz",
23
+ "_shasum": "e75966f99e232b8bd09d8fae02fa247ce0f099cd",
24
+ "_spec": "types-registry@latest",
25
+ "_where": "/home/runner/Hugging-Face-UI-Exercise-MacBook-Pro-5-3/.cache/typescript/4.8",
26
+ "author": {
27
+ "name": "Microsoft Corp."
28
+ },
29
+ "bugs": {
30
+ "url": "https://github.com/microsoft/DefinitelyTyped-tools/issues"
31
+ },
32
+ "bundleDependencies": false,
33
+ "deprecated": false,
34
+ "description": "A registry of TypeScript declaration file packages published within the @types scope.",
35
+ "homepage": "https://github.com/microsoft/DefinitelyTyped-tools#readme",
36
+ "keywords": [
37
+ "TypeScript",
38
+ "declaration",
39
+ "files",
40
+ "types",
41
+ "packages"
42
+ ],
43
+ "license": "MIT",
44
+ "name": "types-registry",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/microsoft/DefinitelyTyped-tools.git",
48
+ "directory": "packages/publisher"
49
+ },
50
+ "typesPublisherContentHash": "778261fdb6ff01765ce2e700a234232d9f1fe2a19a84fe4b80c7e61206575cc6",
51
+ "version": "0.1.684"
52
+ }
.cache/typescript/4.8/package-lock.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "requires": true,
3
+ "lockfileVersion": 1,
4
+ "dependencies": {
5
+ "types-registry": {
6
+ "version": "0.1.684",
7
+ "resolved": "https://registry.npmjs.org/types-registry/-/types-registry-0.1.684.tgz",
8
+ "integrity": "sha512-B6v+g9M+7IJSc1w2THOmTuRKvd/ACxZTGXM18E8MzpHWx1mGUvGGT+RXsSnxNpyqtbjWLeXj8uyyu/MxVOS3xw=="
9
+ }
10
+ }
11
+ }
.cache/typescript/4.8/package.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "private": true,
3
+ "dependencies": {
4
+ "types-registry": "^0.1.684"
5
+ }
6
+ }
.config/configstore/update-notifier-npm.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "optOut": false,
3
+ "lastUpdateCheck": 1708632885794
4
+ }
.deno/dep_analysis_cache_v1 ADDED
Binary file (69.6 kB). View file
 
.deno/dep_analysis_cache_v1-journal ADDED
File without changes
.deno/deps/https/deno.land/0b6eb9ee05f05f2c53ace8ddc098d2f61379d98eb03a8cb59d785b67cf4d4f6b ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+
4
+ import { SEP } from "./separator.ts";
5
+
6
+ /** Determines the common path from a set of paths, using an optional separator,
7
+ * which defaults to the OS default separator.
8
+ *
9
+ * import { common } from "https://deno.land/std/path/mod.ts";
10
+ * const p = common([
11
+ * "./deno/std/path/mod.ts",
12
+ * "./deno/std/fs/mod.ts",
13
+ * ]);
14
+ * console.log(p); // "./deno/std/"
15
+ *
16
+ */
17
+ export function common(paths: string[], sep = SEP): string {
18
+ const [first = "", ...remaining] = paths;
19
+ if (first === "" || remaining.length === 0) {
20
+ return first.substring(0, first.lastIndexOf(sep) + 1);
21
+ }
22
+ const parts = first.split(sep);
23
+
24
+ let endOfPrefix = parts.length;
25
+ for (const path of remaining) {
26
+ const compare = path.split(sep);
27
+ for (let i = 0; i < endOfPrefix; i++) {
28
+ if (compare[i] !== parts[i]) {
29
+ endOfPrefix = i;
30
+ }
31
+ }
32
+
33
+ if (endOfPrefix === 0) {
34
+ return "";
35
+ }
36
+ }
37
+ const prefix = parts.slice(0, endOfPrefix).join(sep);
38
+ return prefix.endsWith(sep) ? prefix : `${prefix}${sep}`;
39
+ }
.deno/deps/https/deno.land/0b6eb9ee05f05f2c53ace8ddc098d2f61379d98eb03a8cb59d785b67cf4d4f6b.metadata.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "headers": {
3
+ "via": "http/2 edgeproxy-h",
4
+ "date": "Wed, 12 Oct 2022 22:13:12 GMT",
5
+ "x-amz-version-id": "M.wLwyV70gRKTb540o38M8ccNq0mS67e",
6
+ "cross-origin-embedder-policy": "same-origin",
7
+ "cross-origin-resource-policy": "same-origin",
8
+ "x-cache": "Hit from cloudfront",
9
+ "content-length": "1166",
10
+ "x-frame-options": "DENY",
11
+ "content-type": "application/typescript; charset=utf-8",
12
+ "cross-origin-opener-policy": "same-origin",
13
+ "etag": "\"563fa4ed09afad6fac675949f387b257\"",
14
+ "server-timing": "fetchSource;dur=38",
15
+ "strict-transport-security": "max-age=63072000; includeSubDomains; preload",
16
+ "vary": "Accept-Encoding, Origin",
17
+ "access-control-allow-origin": "*",
18
+ "accept-ranges": "bytes",
19
+ "age": "29184345",
20
+ "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
21
+ "x-amz-cf-id": "j2LhhtiGgWvdmIhMvYun-jMqYW7xpW1WrhngSmzdPHVDV17irXG81w==",
22
+ "x-content-type-options": "nosniff",
23
+ "cache-control": "public, max-age=31536000, immutable",
24
+ "referrer-policy": "strict-origin-when-cross-origin",
25
+ "x-amz-cf-pop": "SEA73-P3",
26
+ "server": "deno/gcp-us-west1",
27
+ "last-modified": "Wed, 20 Jan 2021 05:26:04 GMT",
28
+ "x-amz-replication-status": "FAILED"
29
+ },
30
+ "url": "https://deno.land/std@0.84.0/path/common.ts",
31
+ "now": {
32
+ "secs_since_epoch": 1694797136,
33
+ "nanos_since_epoch": 682643628
34
+ }
35
+ }
.deno/deps/https/deno.land/0ce54a636d537bee3da40798d6ef467c7259312894dd85635945a8d1d0a9ead3 ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
2
+
3
+ export class DenoStdInternalError extends Error {
4
+ constructor(message: string) {
5
+ super(message);
6
+ this.name = "DenoStdInternalError";
7
+ }
8
+ }
9
+
10
+ /** Make an assertion, if not `true`, then throw. */
11
+ export function assert(expr: unknown, msg = ""): asserts expr {
12
+ if (!expr) {
13
+ throw new DenoStdInternalError(msg);
14
+ }
15
+ }
.deno/deps/https/deno.land/0ce54a636d537bee3da40798d6ef467c7259312894dd85635945a8d1d0a9ead3.metadata.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "headers": {
3
+ "x-amz-cf-pop": "SEA73-P3",
4
+ "content-length": "405",
5
+ "accept-ranges": "bytes",
6
+ "access-control-allow-origin": "*",
7
+ "x-cache": "Hit from cloudfront",
8
+ "x-amz-version-id": "G05Z6nJtvYc0K9LFwPhem5xgny19S1Cv",
9
+ "cache-control": "public, max-age=31536000, immutable",
10
+ "vary": "Accept-Encoding, Origin",
11
+ "age": "262792",
12
+ "cross-origin-embedder-policy": "same-origin",
13
+ "strict-transport-security": "max-age=63072000; includeSubDomains; preload",
14
+ "server": "deno/gcp-us-west1",
15
+ "etag": "\"e5ce4111fb107a7ba5b5f7667b7bda6a\"",
16
+ "cross-origin-opener-policy": "same-origin",
17
+ "referrer-policy": "strict-origin-when-cross-origin",
18
+ "cross-origin-resource-policy": "same-origin",
19
+ "x-frame-options": "DENY",
20
+ "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
21
+ "last-modified": "Fri, 02 Apr 2021 05:03:18 GMT",
22
+ "server-timing": "fetchSource;dur=8",
23
+ "via": "http/2 edgeproxy-h",
24
+ "date": "Tue, 12 Sep 2023 15:59:04 GMT",
25
+ "x-amz-cf-id": "Xe2xywQ9eahkAqyHANV9C0q2dmf39vGN6ArqjS3o_4rgTicsYUtrbQ==",
26
+ "content-type": "application/typescript; charset=utf-8",
27
+ "x-amz-replication-status": "COMPLETED",
28
+ "x-content-type-options": "nosniff"
29
+ },
30
+ "url": "https://deno.land/std@0.92.0/_util/assert.ts",
31
+ "now": {
32
+ "secs_since_epoch": 1694797135,
33
+ "nanos_since_epoch": 970170392
34
+ }
35
+ }
.deno/deps/https/deno.land/169f4312ba164e3f7d36e8ba945c39a3fefff611217384f877c888d77a3c4377 ADDED
The diff for this file is too large to render. See raw diff
 
.deno/deps/https/deno.land/169f4312ba164e3f7d36e8ba945c39a3fefff611217384f877c888d77a3c4377.metadata.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "headers": {
3
+ "cross-origin-embedder-policy": "same-origin",
4
+ "date": "Wed, 12 Oct 2022 22:13:12 GMT",
5
+ "via": "http/2 edgeproxy-h",
6
+ "age": "29184344",
7
+ "content-length": "182511",
8
+ "vary": "Accept-Encoding, Origin",
9
+ "cross-origin-opener-policy": "same-origin",
10
+ "x-content-type-options": "nosniff",
11
+ "server": "deno/gcp-us-west1",
12
+ "etag": "\"2c7c39d15d727b1a45782009be28a2db\"",
13
+ "access-control-allow-origin": "*",
14
+ "accept-ranges": "bytes",
15
+ "cache-control": "public, max-age=31536000, immutable",
16
+ "server-timing": "fetchSource;dur=14",
17
+ "x-amz-cf-id": "RN0Bdfz2yPwV1lnmV2QOs5I_xcLo5Xf0DyOugZKLmcKftolyeZL20g==",
18
+ "x-frame-options": "DENY",
19
+ "last-modified": "Thu, 21 Jan 2021 22:00:02 GMT",
20
+ "x-amz-cf-pop": "SEA73-P3",
21
+ "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
22
+ "referrer-policy": "strict-origin-when-cross-origin",
23
+ "x-amz-version-id": "eb0JK7sqovn9YW.o3nDt6z1Ui7z7ZSB.",
24
+ "x-amz-replication-status": "FAILED",
25
+ "content-type": "application/typescript; charset=utf-8",
26
+ "cross-origin-resource-policy": "same-origin",
27
+ "strict-transport-security": "max-age=63072000; includeSubDomains; preload",
28
+ "x-cache": "Hit from cloudfront"
29
+ },
30
+ "url": "https://deno.land/x/media_types@v2.7.1/db.ts",
31
+ "now": {
32
+ "secs_since_epoch": 1694797135,
33
+ "nanos_since_epoch": 960646533
34
+ }
35
+ }
.deno/deps/https/deno.land/1987df074c07c15283df07b0e8fbe35900df9fdcc9239a24197559f1f383d1dd ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+
4
+ export const osType = (() => {
5
+ if (globalThis.Deno != null) {
6
+ return Deno.build.os;
7
+ }
8
+
9
+ // deno-lint-ignore no-explicit-any
10
+ const navigator = (globalThis as any).navigator;
11
+ if (navigator?.appVersion?.includes?.("Win") ?? false) {
12
+ return "windows";
13
+ }
14
+
15
+ return "linux";
16
+ })();
17
+
18
+ export const isWindows = osType === "windows";
.deno/deps/https/deno.land/1987df074c07c15283df07b0e8fbe35900df9fdcc9239a24197559f1f383d1dd.metadata.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "headers": {
3
+ "via": "http/2 edgeproxy-h",
4
+ "strict-transport-security": "max-age=63072000; includeSubDomains; preload",
5
+ "x-amz-cf-pop": "SEA73-P3",
6
+ "x-amz-replication-status": "FAILED",
7
+ "content-length": "456",
8
+ "cross-origin-resource-policy": "same-origin",
9
+ "referrer-policy": "strict-origin-when-cross-origin",
10
+ "x-frame-options": "DENY",
11
+ "x-amz-cf-id": "C4LEERcqWjMSWrp0Q_Q1Lj9bhYboM0DPFapjMrOkksD0EkxCXjzD0A==",
12
+ "last-modified": "Wed, 20 Jan 2021 05:26:03 GMT",
13
+ "access-control-allow-origin": "*",
14
+ "server-timing": "fetchSource;dur=38",
15
+ "accept-ranges": "bytes",
16
+ "x-amz-version-id": "n4UwmOs2Dq6YPymtAHM_halsvrbD9_TP",
17
+ "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
18
+ "etag": "\"73a9f57dcaabd9ea3ecfb4f0582cee60\"",
19
+ "cross-origin-opener-policy": "same-origin",
20
+ "date": "Wed, 12 Oct 2022 22:13:12 GMT",
21
+ "vary": "Accept-Encoding, Origin",
22
+ "x-cache": "Hit from cloudfront",
23
+ "cross-origin-embedder-policy": "same-origin",
24
+ "x-content-type-options": "nosniff",
25
+ "server": "deno/gcp-us-west1",
26
+ "age": "29184345",
27
+ "cache-control": "public, max-age=31536000, immutable",
28
+ "content-type": "application/typescript; charset=utf-8"
29
+ },
30
+ "url": "https://deno.land/std@0.84.0/_util/os.ts",
31
+ "now": {
32
+ "secs_since_epoch": 1694797136,
33
+ "nanos_since_epoch": 682930808
34
+ }
35
+ }
.deno/deps/https/deno.land/20000027ca53de11171f2184ab15306a7a99339210f33752521b9ab2bcec30bc ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
2
+ import { Deferred, deferred } from "./deferred.ts";
3
+
4
+ interface TaggedYieldedValue<T> {
5
+ iterator: AsyncIterableIterator<T>;
6
+ value: T;
7
+ }
8
+
9
+ /** The MuxAsyncIterator class multiplexes multiple async iterators into a
10
+ * single stream. It currently makes an assumption:
11
+ * - The final result (the value returned and not yielded from the iterator)
12
+ * does not matter; if there is any, it is discarded.
13
+ */
14
+ export class MuxAsyncIterator<T> implements AsyncIterable<T> {
15
+ private iteratorCount = 0;
16
+ private yields: Array<TaggedYieldedValue<T>> = [];
17
+ // deno-lint-ignore no-explicit-any
18
+ private throws: any[] = [];
19
+ private signal: Deferred<void> = deferred();
20
+
21
+ add(iterator: AsyncIterableIterator<T>): void {
22
+ ++this.iteratorCount;
23
+ this.callIteratorNext(iterator);
24
+ }
25
+
26
+ private async callIteratorNext(
27
+ iterator: AsyncIterableIterator<T>,
28
+ ): Promise<void> {
29
+ try {
30
+ const { value, done } = await iterator.next();
31
+ if (done) {
32
+ --this.iteratorCount;
33
+ } else {
34
+ this.yields.push({ iterator, value });
35
+ }
36
+ } catch (e) {
37
+ this.throws.push(e);
38
+ }
39
+ this.signal.resolve();
40
+ }
41
+
42
+ async *iterate(): AsyncIterableIterator<T> {
43
+ while (this.iteratorCount > 0) {
44
+ // Sleep until any of the wrapped iterators yields.
45
+ await this.signal;
46
+
47
+ // Note that while we're looping over `yields`, new items may be added.
48
+ for (let i = 0; i < this.yields.length; i++) {
49
+ const { iterator, value } = this.yields[i];
50
+ yield value;
51
+ this.callIteratorNext(iterator);
52
+ }
53
+
54
+ if (this.throws.length) {
55
+ for (const e of this.throws) {
56
+ throw e;
57
+ }
58
+ this.throws.length = 0;
59
+ }
60
+ // Clear the `yields` list and reset the `signal` promise.
61
+ this.yields.length = 0;
62
+ this.signal = deferred();
63
+ }
64
+ }
65
+
66
+ [Symbol.asyncIterator](): AsyncIterableIterator<T> {
67
+ return this.iterate();
68
+ }
69
+ }
.deno/deps/https/deno.land/20000027ca53de11171f2184ab15306a7a99339210f33752521b9ab2bcec30bc.metadata.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "headers": {
3
+ "cross-origin-opener-policy": "same-origin",
4
+ "accept-ranges": "bytes",
5
+ "age": "28964322",
6
+ "content-length": "2005",
7
+ "content-type": "application/typescript; charset=utf-8",
8
+ "via": "http/2 edgeproxy-h",
9
+ "x-amz-cf-id": "foMtX0yX5JYdX2F9Dyxuoem6uEAGQZP9dnMpmwuROeg7BylqA-I_4w==",
10
+ "x-amz-cf-pop": "SEA73-P3",
11
+ "cross-origin-embedder-policy": "same-origin",
12
+ "x-amz-version-id": "phII7fkU7ZsJjsthUmX7Q_3V9sfgv43Q",
13
+ "x-cache": "Hit from cloudfront",
14
+ "x-content-type-options": "nosniff",
15
+ "last-modified": "Fri, 02 Apr 2021 05:03:18 GMT",
16
+ "vary": "Accept-Encoding, Origin",
17
+ "date": "Sat, 15 Oct 2022 11:20:15 GMT",
18
+ "x-frame-options": "DENY",
19
+ "x-amz-replication-status": "FAILED",
20
+ "referrer-policy": "strict-origin-when-cross-origin",
21
+ "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
22
+ "access-control-allow-origin": "*",
23
+ "cache-control": "public, max-age=31536000, immutable",
24
+ "cross-origin-resource-policy": "same-origin",
25
+ "etag": "\"a7665ec4b3e56b1a20c3aabed42f7dd9\"",
26
+ "server": "deno/gcp-us-west1",
27
+ "strict-transport-security": "max-age=63072000; includeSubDomains; preload",
28
+ "server-timing": "fetchSource;dur=16"
29
+ },
30
+ "url": "https://deno.land/std@0.92.0/async/mux_async_iterator.ts",
31
+ "now": {
32
+ "secs_since_epoch": 1694797136,
33
+ "nanos_since_epoch": 323953111
34
+ }
35
+ }
.deno/deps/https/deno.land/240abb71b35597950024783a333e95a7489019d12858652d2d75c91020b1a52f ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright the Browserify authors. MIT License.
2
+ // Ported from https://github.com/browserify/path-browserify/
3
+ // This module is browser compatible.
4
+
5
+ // Alphabet chars.
6
+ export const CHAR_UPPERCASE_A = 65; /* A */
7
+ export const CHAR_LOWERCASE_A = 97; /* a */
8
+ export const CHAR_UPPERCASE_Z = 90; /* Z */
9
+ export const CHAR_LOWERCASE_Z = 122; /* z */
10
+
11
+ // Non-alphabetic chars.
12
+ export const CHAR_DOT = 46; /* . */
13
+ export const CHAR_FORWARD_SLASH = 47; /* / */
14
+ export const CHAR_BACKWARD_SLASH = 92; /* \ */
15
+ export const CHAR_VERTICAL_LINE = 124; /* | */
16
+ export const CHAR_COLON = 58; /* : */
17
+ export const CHAR_QUESTION_MARK = 63; /* ? */
18
+ export const CHAR_UNDERSCORE = 95; /* _ */
19
+ export const CHAR_LINE_FEED = 10; /* \n */
20
+ export const CHAR_CARRIAGE_RETURN = 13; /* \r */
21
+ export const CHAR_TAB = 9; /* \t */
22
+ export const CHAR_FORM_FEED = 12; /* \f */
23
+ export const CHAR_EXCLAMATION_MARK = 33; /* ! */
24
+ export const CHAR_HASH = 35; /* # */
25
+ export const CHAR_SPACE = 32; /* */
26
+ export const CHAR_NO_BREAK_SPACE = 160; /* \u00A0 */
27
+ export const CHAR_ZERO_WIDTH_NOBREAK_SPACE = 65279; /* \uFEFF */
28
+ export const CHAR_LEFT_SQUARE_BRACKET = 91; /* [ */
29
+ export const CHAR_RIGHT_SQUARE_BRACKET = 93; /* ] */
30
+ export const CHAR_LEFT_ANGLE_BRACKET = 60; /* < */
31
+ export const CHAR_RIGHT_ANGLE_BRACKET = 62; /* > */
32
+ export const CHAR_LEFT_CURLY_BRACKET = 123; /* { */
33
+ export const CHAR_RIGHT_CURLY_BRACKET = 125; /* } */
34
+ export const CHAR_HYPHEN_MINUS = 45; /* - */
35
+ export const CHAR_PLUS = 43; /* + */
36
+ export const CHAR_DOUBLE_QUOTE = 34; /* " */
37
+ export const CHAR_SINGLE_QUOTE = 39; /* ' */
38
+ export const CHAR_PERCENT = 37; /* % */
39
+ export const CHAR_SEMICOLON = 59; /* ; */
40
+ export const CHAR_CIRCUMFLEX_ACCENT = 94; /* ^ */
41
+ export const CHAR_GRAVE_ACCENT = 96; /* ` */
42
+ export const CHAR_AT = 64; /* @ */
43
+ export const CHAR_AMPERSAND = 38; /* & */
44
+ export const CHAR_EQUAL = 61; /* = */
45
+
46
+ // Digits
47
+ export const CHAR_0 = 48; /* 0 */
48
+ export const CHAR_9 = 57; /* 9 */
.deno/deps/https/deno.land/240abb71b35597950024783a333e95a7489019d12858652d2d75c91020b1a52f.metadata.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "headers": {
3
+ "last-modified": "Wed, 20 Jan 2021 05:26:04 GMT",
4
+ "date": "Wed, 12 Oct 2022 22:13:13 GMT",
5
+ "cache-control": "public, max-age=31536000, immutable",
6
+ "content-type": "application/typescript; charset=utf-8",
7
+ "x-amz-replication-status": "FAILED",
8
+ "cross-origin-resource-policy": "same-origin",
9
+ "accept-ranges": "bytes",
10
+ "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
11
+ "referrer-policy": "strict-origin-when-cross-origin",
12
+ "vary": "Accept-Encoding, Origin",
13
+ "server": "deno/gcp-us-west1",
14
+ "x-amz-cf-id": "XDsaLiu32GlAlW6orfKPyUZP-Q3wNyJjeu5gKnrJp-J-PInlgxz16w==",
15
+ "x-amz-cf-pop": "SEA73-P3",
16
+ "age": "29184344",
17
+ "server-timing": "fetchSource;dur=8",
18
+ "x-cache": "Hit from cloudfront",
19
+ "x-amz-version-id": "dGa1UO4xphJcao3sc2rTDHGhl2cnI26d",
20
+ "etag": "\"750ae0df3aaa0c8fdff773c40588fc59\"",
21
+ "x-frame-options": "DENY",
22
+ "access-control-allow-origin": "*",
23
+ "content-length": "1945",
24
+ "cross-origin-embedder-policy": "same-origin",
25
+ "cross-origin-opener-policy": "same-origin",
26
+ "strict-transport-security": "max-age=63072000; includeSubDomains; preload",
27
+ "via": "http/2 edgeproxy-h",
28
+ "x-content-type-options": "nosniff"
29
+ },
30
+ "url": "https://deno.land/std@0.84.0/path/_constants.ts",
31
+ "now": {
32
+ "secs_since_epoch": 1694797136,
33
+ "nanos_since_epoch": 834319757
34
+ }
35
+ }
.deno/deps/https/deno.land/2458f931dced104bb23594f63096f7a2afa1e78bba99527b6ad35426d516b247 ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
2
+ /* Resolves after the given number of milliseconds. */
3
+ export function delay(ms: number): Promise<void> {
4
+ return new Promise((res): number =>
5
+ setTimeout((): void => {
6
+ res();
7
+ }, ms)
8
+ );
9
+ }
.deno/deps/https/deno.land/2458f931dced104bb23594f63096f7a2afa1e78bba99527b6ad35426d516b247.metadata.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "headers": {
3
+ "x-cache": "Hit from cloudfront",
4
+ "cross-origin-embedder-policy": "same-origin",
5
+ "strict-transport-security": "max-age=63072000; includeSubDomains; preload",
6
+ "x-amz-replication-status": "FAILED",
7
+ "x-amz-version-id": "heAiVjIsgbCBe51RCfQMlKy_rNZGpWZ9",
8
+ "x-content-type-options": "nosniff",
9
+ "cross-origin-opener-policy": "same-origin",
10
+ "date": "Tue, 25 Oct 2022 13:29:43 GMT",
11
+ "cross-origin-resource-policy": "same-origin",
12
+ "access-control-allow-origin": "*",
13
+ "referrer-policy": "strict-origin-when-cross-origin",
14
+ "server-timing": "fetchSource;dur=18",
15
+ "vary": "Accept-Encoding, Origin",
16
+ "accept-ranges": "bytes",
17
+ "server": "deno/gcp-us-west1",
18
+ "x-amz-cf-id": "lA96vgtSJPSgBHYf80tJFAf8yW2nfPWZt-hYkH5izcvLBDx6RXMLdA==",
19
+ "last-modified": "Fri, 02 Apr 2021 05:03:18 GMT",
20
+ "etag": "\"2a1b90f6d604cf64c28f8f93b98109af\"",
21
+ "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
22
+ "content-type": "application/typescript; charset=utf-8",
23
+ "cache-control": "public, max-age=31536000, immutable",
24
+ "age": "28092554",
25
+ "via": "http/2 edgeproxy-h",
26
+ "x-amz-cf-pop": "SEA73-P3",
27
+ "content-length": "279",
28
+ "x-frame-options": "DENY"
29
+ },
30
+ "url": "https://deno.land/std@0.92.0/async/delay.ts",
31
+ "now": {
32
+ "secs_since_epoch": 1694797136,
33
+ "nanos_since_epoch": 327206309
34
+ }
35
+ }
.deno/deps/https/deno.land/2d42e05955049935cf121ad3d14d949da14b4c2ec355b1ac41b8bd233b186fc6 ADDED
@@ -0,0 +1,260 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { assert } from "../_util/assert.ts";
2
+
3
+ // MIN_READ is the minimum ArrayBuffer size passed to a read call by
4
+ // buffer.ReadFrom. As long as the Buffer has at least MIN_READ bytes beyond
5
+ // what is required to hold the contents of r, readFrom() will not grow the
6
+ // underlying buffer.
7
+ const MIN_READ = 32 * 1024;
8
+ const MAX_SIZE = 2 ** 32 - 2;
9
+
10
+ // `off` is the offset into `dst` where it will at which to begin writing values
11
+ // from `src`.
12
+ // Returns the number of bytes copied.
13
+ function copyBytes(src: Uint8Array, dst: Uint8Array, off = 0) {
14
+ const r = dst.byteLength - off;
15
+ if (src.byteLength > r) {
16
+ src = src.subarray(0, r);
17
+ }
18
+ dst.set(src, off);
19
+ return src.byteLength;
20
+ }
21
+
22
+ /** A variable-sized buffer of bytes with `read()` and `write()` methods.
23
+ *
24
+ * Buffer is almost always used with some I/O like files and sockets. It allows
25
+ * one to buffer up a download from a socket. Buffer grows and shrinks as
26
+ * necessary.
27
+ *
28
+ * Buffer is NOT the same thing as Node's Buffer. Node's Buffer was created in
29
+ * 2009 before JavaScript had the concept of ArrayBuffers. It's simply a
30
+ * non-standard ArrayBuffer.
31
+ *
32
+ * ArrayBuffer is a fixed memory allocation. Buffer is implemented on top of
33
+ * ArrayBuffer.
34
+ *
35
+ * Based on [Go Buffer](https://golang.org/pkg/bytes/#Buffer). */
36
+
37
+ export class Buffer {
38
+ #buf: Uint8Array; // contents are the bytes buf[off : len(buf)]
39
+ #off = 0; // read at buf[off], write at buf[buf.byteLength]
40
+
41
+ constructor(ab?: ArrayBuffer) {
42
+ if (ab === undefined) {
43
+ this.#buf = new Uint8Array(0);
44
+ return;
45
+ }
46
+ this.#buf = new Uint8Array(ab);
47
+ }
48
+
49
+ /** Returns a slice holding the unread portion of the buffer.
50
+ *
51
+ * The slice is valid for use only until the next buffer modification (that
52
+ * is, only until the next call to a method like `read()`, `write()`,
53
+ * `reset()`, or `truncate()`). If `options.copy` is false the slice aliases the buffer content at
54
+ * least until the next buffer modification, so immediate changes to the
55
+ * slice will affect the result of future reads.
56
+ * @param options Defaults to `{ copy: true }`
57
+ */
58
+ bytes(options = { copy: true }): Uint8Array {
59
+ if (options.copy === false) return this.#buf.subarray(this.#off);
60
+ return this.#buf.slice(this.#off);
61
+ }
62
+
63
+ /** Returns whether the unread portion of the buffer is empty. */
64
+ empty(): boolean {
65
+ return this.#buf.byteLength <= this.#off;
66
+ }
67
+
68
+ /** A read only number of bytes of the unread portion of the buffer. */
69
+ get length(): number {
70
+ return this.#buf.byteLength - this.#off;
71
+ }
72
+
73
+ /** The read only capacity of the buffer's underlying byte slice, that is,
74
+ * the total space allocated for the buffer's data. */
75
+ get capacity(): number {
76
+ return this.#buf.buffer.byteLength;
77
+ }
78
+
79
+ /** Discards all but the first `n` unread bytes from the buffer but
80
+ * continues to use the same allocated storage. It throws if `n` is
81
+ * negative or greater than the length of the buffer. */
82
+ truncate(n: number): void {
83
+ if (n === 0) {
84
+ this.reset();
85
+ return;
86
+ }
87
+ if (n < 0 || n > this.length) {
88
+ throw Error("bytes.Buffer: truncation out of range");
89
+ }
90
+ this.#reslice(this.#off + n);
91
+ }
92
+
93
+ reset(): void {
94
+ this.#reslice(0);
95
+ this.#off = 0;
96
+ }
97
+
98
+ #tryGrowByReslice = (n: number) => {
99
+ const l = this.#buf.byteLength;
100
+ if (n <= this.capacity - l) {
101
+ this.#reslice(l + n);
102
+ return l;
103
+ }
104
+ return -1;
105
+ };
106
+
107
+ #reslice = (len: number) => {
108
+ assert(len <= this.#buf.buffer.byteLength);
109
+ this.#buf = new Uint8Array(this.#buf.buffer, 0, len);
110
+ };
111
+
112
+ /** Reads the next `p.length` bytes from the buffer or until the buffer is
113
+ * drained. Returns the number of bytes read. If the buffer has no data to
114
+ * return, the return is EOF (`null`). */
115
+ readSync(p: Uint8Array): number | null {
116
+ if (this.empty()) {
117
+ // Buffer is empty, reset to recover space.
118
+ this.reset();
119
+ if (p.byteLength === 0) {
120
+ // this edge case is tested in 'bufferReadEmptyAtEOF' test
121
+ return 0;
122
+ }
123
+ return null;
124
+ }
125
+ const nread = copyBytes(this.#buf.subarray(this.#off), p);
126
+ this.#off += nread;
127
+ return nread;
128
+ }
129
+
130
+ /** Reads the next `p.length` bytes from the buffer or until the buffer is
131
+ * drained. Resolves to the number of bytes read. If the buffer has no
132
+ * data to return, resolves to EOF (`null`).
133
+ *
134
+ * NOTE: This methods reads bytes synchronously; it's provided for
135
+ * compatibility with `Reader` interfaces.
136
+ */
137
+ read(p: Uint8Array): Promise<number | null> {
138
+ const rr = this.readSync(p);
139
+ return Promise.resolve(rr);
140
+ }
141
+
142
+ writeSync(p: Uint8Array): number {
143
+ const m = this.#grow(p.byteLength);
144
+ return copyBytes(p, this.#buf, m);
145
+ }
146
+
147
+ /** NOTE: This methods writes bytes synchronously; it's provided for
148
+ * compatibility with `Writer` interface. */
149
+ write(p: Uint8Array): Promise<number> {
150
+ const n = this.writeSync(p);
151
+ return Promise.resolve(n);
152
+ }
153
+
154
+ #grow = (n: number) => {
155
+ const m = this.length;
156
+ // If buffer is empty, reset to recover space.
157
+ if (m === 0 && this.#off !== 0) {
158
+ this.reset();
159
+ }
160
+ // Fast: Try to grow by means of a reslice.
161
+ const i = this.#tryGrowByReslice(n);
162
+ if (i >= 0) {
163
+ return i;
164
+ }
165
+ const c = this.capacity;
166
+ if (n <= Math.floor(c / 2) - m) {
167
+ // We can slide things down instead of allocating a new
168
+ // ArrayBuffer. We only need m+n <= c to slide, but
169
+ // we instead let capacity get twice as large so we
170
+ // don't spend all our time copying.
171
+ copyBytes(this.#buf.subarray(this.#off), this.#buf);
172
+ } else if (c + n > MAX_SIZE) {
173
+ throw new Error("The buffer cannot be grown beyond the maximum size.");
174
+ } else {
175
+ // Not enough space anywhere, we need to allocate.
176
+ const buf = new Uint8Array(Math.min(2 * c + n, MAX_SIZE));
177
+ copyBytes(this.#buf.subarray(this.#off), buf);
178
+ this.#buf = buf;
179
+ }
180
+ // Restore this.#off and len(this.#buf).
181
+ this.#off = 0;
182
+ this.#reslice(Math.min(m + n, MAX_SIZE));
183
+ return m;
184
+ };
185
+
186
+ /** Grows the buffer's capacity, if necessary, to guarantee space for
187
+ * another `n` bytes. After `.grow(n)`, at least `n` bytes can be written to
188
+ * the buffer without another allocation. If `n` is negative, `.grow()` will
189
+ * throw. If the buffer can't grow it will throw an error.
190
+ *
191
+ * Based on Go Lang's
192
+ * [Buffer.Grow](https://golang.org/pkg/bytes/#Buffer.Grow). */
193
+ grow(n: number): void {
194
+ if (n < 0) {
195
+ throw Error("Buffer.grow: negative count");
196
+ }
197
+ const m = this.#grow(n);
198
+ this.#reslice(m);
199
+ }
200
+
201
+ /** Reads data from `r` until EOF (`null`) and appends it to the buffer,
202
+ * growing the buffer as needed. It resolves to the number of bytes read.
203
+ * If the buffer becomes too large, `.readFrom()` will reject with an error.
204
+ *
205
+ * Based on Go Lang's
206
+ * [Buffer.ReadFrom](https://golang.org/pkg/bytes/#Buffer.ReadFrom). */
207
+ async readFrom(r: Deno.Reader): Promise<number> {
208
+ let n = 0;
209
+ const tmp = new Uint8Array(MIN_READ);
210
+ while (true) {
211
+ const shouldGrow = this.capacity - this.length < MIN_READ;
212
+ // read into tmp buffer if there's not enough room
213
+ // otherwise read directly into the internal buffer
214
+ const buf = shouldGrow
215
+ ? tmp
216
+ : new Uint8Array(this.#buf.buffer, this.length);
217
+
218
+ const nread = await r.read(buf);
219
+ if (nread === null) {
220
+ return n;
221
+ }
222
+
223
+ // write will grow if needed
224
+ if (shouldGrow) this.writeSync(buf.subarray(0, nread));
225
+ else this.#reslice(this.length + nread);
226
+
227
+ n += nread;
228
+ }
229
+ }
230
+
231
+ /** Reads data from `r` until EOF (`null`) and appends it to the buffer,
232
+ * growing the buffer as needed. It returns the number of bytes read. If the
233
+ * buffer becomes too large, `.readFromSync()` will throw an error.
234
+ *
235
+ * Based on Go Lang's
236
+ * [Buffer.ReadFrom](https://golang.org/pkg/bytes/#Buffer.ReadFrom). */
237
+ readFromSync(r: Deno.ReaderSync): number {
238
+ let n = 0;
239
+ const tmp = new Uint8Array(MIN_READ);
240
+ while (true) {
241
+ const shouldGrow = this.capacity - this.length < MIN_READ;
242
+ // read into tmp buffer if there's not enough room
243
+ // otherwise read directly into the internal buffer
244
+ const buf = shouldGrow
245
+ ? tmp
246
+ : new Uint8Array(this.#buf.buffer, this.length);
247
+
248
+ const nread = r.readSync(buf);
249
+ if (nread === null) {
250
+ return n;
251
+ }
252
+
253
+ // write will grow if needed
254
+ if (shouldGrow) this.writeSync(buf.subarray(0, nread));
255
+ else this.#reslice(this.length + nread);
256
+
257
+ n += nread;
258
+ }
259
+ }
260
+ }
.deno/deps/https/deno.land/2d42e05955049935cf121ad3d14d949da14b4c2ec355b1ac41b8bd233b186fc6.metadata.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "headers": {
3
+ "content-length": "8611",
4
+ "x-amz-cf-id": "TM1nvLIJ1ARbK6fhXSMEhLkxW2m67XIIKicuQx9xeZqNvzNNWxizCQ==",
5
+ "accept-ranges": "bytes",
6
+ "via": "http/2 edgeproxy-h",
7
+ "cross-origin-embedder-policy": "same-origin",
8
+ "strict-transport-security": "max-age=63072000; includeSubDomains; preload",
9
+ "x-frame-options": "DENY",
10
+ "age": "28911889",
11
+ "x-amz-replication-status": "FAILED",
12
+ "x-content-type-options": "nosniff",
13
+ "x-amz-version-id": "rhMzDzR7448iIXW6ppubo2MLvN6JQiV4",
14
+ "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
15
+ "etag": "\"c34569fd68e7ef43167d844b7731b89c\"",
16
+ "cache-control": "public, max-age=31536000, immutable",
17
+ "cross-origin-resource-policy": "same-origin",
18
+ "server-timing": "fetchSource;dur=16",
19
+ "x-amz-cf-pop": "SEA73-P3",
20
+ "server": "deno/gcp-us-west1",
21
+ "x-cache": "Hit from cloudfront",
22
+ "content-type": "application/typescript; charset=utf-8",
23
+ "access-control-allow-origin": "*",
24
+ "referrer-policy": "strict-origin-when-cross-origin",
25
+ "cross-origin-opener-policy": "same-origin",
26
+ "last-modified": "Fri, 02 Apr 2021 05:03:19 GMT",
27
+ "vary": "Accept-Encoding, Origin",
28
+ "date": "Sun, 16 Oct 2022 01:54:08 GMT"
29
+ },
30
+ "url": "https://deno.land/std@0.92.0/io/buffer.ts",
31
+ "now": {
32
+ "secs_since_epoch": 1694797136,
33
+ "nanos_since_epoch": 323071632
34
+ }
35
+ }
.deno/deps/https/deno.land/3b4317ea97e012608910e529127dce91d98e61254b54f99ea91efa07d92b8f44 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ // Copyright 2020 the oak authors. All rights reserved. MIT license.
2
+
3
+ export { extname } from "https://deno.land/std@0.84.0/path/mod.ts";
.deno/deps/https/deno.land/3b4317ea97e012608910e529127dce91d98e61254b54f99ea91efa07d92b8f44.metadata.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "headers": {
3
+ "content-length": "138",
4
+ "referrer-policy": "strict-origin-when-cross-origin",
5
+ "x-cache": "Hit from cloudfront",
6
+ "age": "29184344",
7
+ "server-timing": "fetchSource;dur=8",
8
+ "content-type": "application/typescript; charset=utf-8",
9
+ "server": "deno/gcp-us-west1",
10
+ "via": "http/2 edgeproxy-h",
11
+ "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
12
+ "date": "Wed, 12 Oct 2022 22:13:12 GMT",
13
+ "x-amz-cf-pop": "SEA73-P3",
14
+ "accept-ranges": "bytes",
15
+ "cross-origin-embedder-policy": "same-origin",
16
+ "strict-transport-security": "max-age=63072000; includeSubDomains; preload",
17
+ "x-amz-replication-status": "FAILED",
18
+ "last-modified": "Thu, 21 Jan 2021 22:00:01 GMT",
19
+ "vary": "Accept-Encoding, Origin",
20
+ "cross-origin-resource-policy": "same-origin",
21
+ "x-amz-version-id": "wIJvRMivbXZPHNDnPCOAWDvOX151ZbqX",
22
+ "x-content-type-options": "nosniff",
23
+ "cross-origin-opener-policy": "same-origin",
24
+ "access-control-allow-origin": "*",
25
+ "cache-control": "public, max-age=31536000, immutable",
26
+ "x-frame-options": "DENY",
27
+ "x-amz-cf-id": "WXgjgPjAM-9Zuo32nU7DHyh8023hlTtW4Z7QcSefkLbevaM736YJVQ==",
28
+ "etag": "\"4587fa3fc70c9510c07ceba5e5c25346\""
29
+ },
30
+ "url": "https://deno.land/x/media_types@v2.7.1/deps.ts",
31
+ "now": {
32
+ "secs_since_epoch": 1694797135,
33
+ "nanos_since_epoch": 840987197
34
+ }
35
+ }
.deno/deps/https/deno.land/4e07f5fc21ab1b67b23874d4aec7875cfe6150e248d2e7676c7fad62ad05152b ADDED
@@ -0,0 +1,1002 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright the Browserify authors. MIT License.
2
+ // Ported from https://github.com/browserify/path-browserify/
3
+ // This module is browser compatible.
4
+
5
+ import type { FormatInputPathObject, ParsedPath } from "./_interface.ts";
6
+ import {
7
+ CHAR_BACKWARD_SLASH,
8
+ CHAR_COLON,
9
+ CHAR_DOT,
10
+ CHAR_QUESTION_MARK,
11
+ } from "./_constants.ts";
12
+
13
+ import {
14
+ _format,
15
+ assertPath,
16
+ encodeWhitespace,
17
+ isPathSeparator,
18
+ isWindowsDeviceRoot,
19
+ normalizeString,
20
+ } from "./_util.ts";
21
+ import { assert } from "../_util/assert.ts";
22
+
23
+ export const sep = "\\";
24
+ export const delimiter = ";";
25
+
26
+ /**
27
+ * Resolves path segments into a `path`
28
+ * @param pathSegments to process to path
29
+ */
30
+ export function resolve(...pathSegments: string[]): string {
31
+ let resolvedDevice = "";
32
+ let resolvedTail = "";
33
+ let resolvedAbsolute = false;
34
+
35
+ for (let i = pathSegments.length - 1; i >= -1; i--) {
36
+ let path: string;
37
+ if (i >= 0) {
38
+ path = pathSegments[i];
39
+ } else if (!resolvedDevice) {
40
+ if (globalThis.Deno == null) {
41
+ throw new TypeError("Resolved a drive-letter-less path without a CWD.");
42
+ }
43
+ path = Deno.cwd();
44
+ } else {
45
+ if (globalThis.Deno == null) {
46
+ throw new TypeError("Resolved a relative path without a CWD.");
47
+ }
48
+ // Windows has the concept of drive-specific current working
49
+ // directories. If we've resolved a drive letter but not yet an
50
+ // absolute path, get cwd for that drive, or the process cwd if
51
+ // the drive cwd is not available. We're sure the device is not
52
+ // a UNC path at this points, because UNC paths are always absolute.
53
+ path = Deno.env.get(`=${resolvedDevice}`) || Deno.cwd();
54
+
55
+ // Verify that a cwd was found and that it actually points
56
+ // to our drive. If not, default to the drive's root.
57
+ if (
58
+ path === undefined ||
59
+ path.slice(0, 3).toLowerCase() !== `${resolvedDevice.toLowerCase()}\\`
60
+ ) {
61
+ path = `${resolvedDevice}\\`;
62
+ }
63
+ }
64
+
65
+ assertPath(path);
66
+
67
+ const len = path.length;
68
+
69
+ // Skip empty entries
70
+ if (len === 0) continue;
71
+
72
+ let rootEnd = 0;
73
+ let device = "";
74
+ let isAbsolute = false;
75
+ const code = path.charCodeAt(0);
76
+
77
+ // Try to match a root
78
+ if (len > 1) {
79
+ if (isPathSeparator(code)) {
80
+ // Possible UNC root
81
+
82
+ // If we started with a separator, we know we at least have an
83
+ // absolute path of some kind (UNC or otherwise)
84
+ isAbsolute = true;
85
+
86
+ if (isPathSeparator(path.charCodeAt(1))) {
87
+ // Matched double path separator at beginning
88
+ let j = 2;
89
+ let last = j;
90
+ // Match 1 or more non-path separators
91
+ for (; j < len; ++j) {
92
+ if (isPathSeparator(path.charCodeAt(j))) break;
93
+ }
94
+ if (j < len && j !== last) {
95
+ const firstPart = path.slice(last, j);
96
+ // Matched!
97
+ last = j;
98
+ // Match 1 or more path separators
99
+ for (; j < len; ++j) {
100
+ if (!isPathSeparator(path.charCodeAt(j))) break;
101
+ }
102
+ if (j < len && j !== last) {
103
+ // Matched!
104
+ last = j;
105
+ // Match 1 or more non-path separators
106
+ for (; j < len; ++j) {
107
+ if (isPathSeparator(path.charCodeAt(j))) break;
108
+ }
109
+ if (j === len) {
110
+ // We matched a UNC root only
111
+ device = `\\\\${firstPart}\\${path.slice(last)}`;
112
+ rootEnd = j;
113
+ } else if (j !== last) {
114
+ // We matched a UNC root with leftovers
115
+
116
+ device = `\\\\${firstPart}\\${path.slice(last, j)}`;
117
+ rootEnd = j;
118
+ }
119
+ }
120
+ }
121
+ } else {
122
+ rootEnd = 1;
123
+ }
124
+ } else if (isWindowsDeviceRoot(code)) {
125
+ // Possible device root
126
+
127
+ if (path.charCodeAt(1) === CHAR_COLON) {
128
+ device = path.slice(0, 2);
129
+ rootEnd = 2;
130
+ if (len > 2) {
131
+ if (isPathSeparator(path.charCodeAt(2))) {
132
+ // Treat separator following drive name as an absolute path
133
+ // indicator
134
+ isAbsolute = true;
135
+ rootEnd = 3;
136
+ }
137
+ }
138
+ }
139
+ }
140
+ } else if (isPathSeparator(code)) {
141
+ // `path` contains just a path separator
142
+ rootEnd = 1;
143
+ isAbsolute = true;
144
+ }
145
+
146
+ if (
147
+ device.length > 0 &&
148
+ resolvedDevice.length > 0 &&
149
+ device.toLowerCase() !== resolvedDevice.toLowerCase()
150
+ ) {
151
+ // This path points to another device so it is not applicable
152
+ continue;
153
+ }
154
+
155
+ if (resolvedDevice.length === 0 && device.length > 0) {
156
+ resolvedDevice = device;
157
+ }
158
+ if (!resolvedAbsolute) {
159
+ resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
160
+ resolvedAbsolute = isAbsolute;
161
+ }
162
+
163
+ if (resolvedAbsolute && resolvedDevice.length > 0) break;
164
+ }
165
+
166
+ // At this point the path should be resolved to a full absolute path,
167
+ // but handle relative paths to be safe (might happen when process.cwd()
168
+ // fails)
169
+
170
+ // Normalize the tail path
171
+ resolvedTail = normalizeString(
172
+ resolvedTail,
173
+ !resolvedAbsolute,
174
+ "\\",
175
+ isPathSeparator,
176
+ );
177
+
178
+ return resolvedDevice + (resolvedAbsolute ? "\\" : "") + resolvedTail || ".";
179
+ }
180
+
181
+ /**
182
+ * Normalizes a `path`
183
+ * @param path to normalize
184
+ */
185
+ export function normalize(path: string): string {
186
+ assertPath(path);
187
+ const len = path.length;
188
+ if (len === 0) return ".";
189
+ let rootEnd = 0;
190
+ let device: string | undefined;
191
+ let isAbsolute = false;
192
+ const code = path.charCodeAt(0);
193
+
194
+ // Try to match a root
195
+ if (len > 1) {
196
+ if (isPathSeparator(code)) {
197
+ // Possible UNC root
198
+
199
+ // If we started with a separator, we know we at least have an absolute
200
+ // path of some kind (UNC or otherwise)
201
+ isAbsolute = true;
202
+
203
+ if (isPathSeparator(path.charCodeAt(1))) {
204
+ // Matched double path separator at beginning
205
+ let j = 2;
206
+ let last = j;
207
+ // Match 1 or more non-path separators
208
+ for (; j < len; ++j) {
209
+ if (isPathSeparator(path.charCodeAt(j))) break;
210
+ }
211
+ if (j < len && j !== last) {
212
+ const firstPart = path.slice(last, j);
213
+ // Matched!
214
+ last = j;
215
+ // Match 1 or more path separators
216
+ for (; j < len; ++j) {
217
+ if (!isPathSeparator(path.charCodeAt(j))) break;
218
+ }
219
+ if (j < len && j !== last) {
220
+ // Matched!
221
+ last = j;
222
+ // Match 1 or more non-path separators
223
+ for (; j < len; ++j) {
224
+ if (isPathSeparator(path.charCodeAt(j))) break;
225
+ }
226
+ if (j === len) {
227
+ // We matched a UNC root only
228
+ // Return the normalized version of the UNC root since there
229
+ // is nothing left to process
230
+
231
+ return `\\\\${firstPart}\\${path.slice(last)}\\`;
232
+ } else if (j !== last) {
233
+ // We matched a UNC root with leftovers
234
+
235
+ device = `\\\\${firstPart}\\${path.slice(last, j)}`;
236
+ rootEnd = j;
237
+ }
238
+ }
239
+ }
240
+ } else {
241
+ rootEnd = 1;
242
+ }
243
+ } else if (isWindowsDeviceRoot(code)) {
244
+ // Possible device root
245
+
246
+ if (path.charCodeAt(1) === CHAR_COLON) {
247
+ device = path.slice(0, 2);
248
+ rootEnd = 2;
249
+ if (len > 2) {
250
+ if (isPathSeparator(path.charCodeAt(2))) {
251
+ // Treat separator following drive name as an absolute path
252
+ // indicator
253
+ isAbsolute = true;
254
+ rootEnd = 3;
255
+ }
256
+ }
257
+ }
258
+ }
259
+ } else if (isPathSeparator(code)) {
260
+ // `path` contains just a path separator, exit early to avoid unnecessary
261
+ // work
262
+ return "\\";
263
+ }
264
+
265
+ let tail: string;
266
+ if (rootEnd < len) {
267
+ tail = normalizeString(
268
+ path.slice(rootEnd),
269
+ !isAbsolute,
270
+ "\\",
271
+ isPathSeparator,
272
+ );
273
+ } else {
274
+ tail = "";
275
+ }
276
+ if (tail.length === 0 && !isAbsolute) tail = ".";
277
+ if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) {
278
+ tail += "\\";
279
+ }
280
+ if (device === undefined) {
281
+ if (isAbsolute) {
282
+ if (tail.length > 0) return `\\${tail}`;
283
+ else return "\\";
284
+ } else if (tail.length > 0) {
285
+ return tail;
286
+ } else {
287
+ return "";
288
+ }
289
+ } else if (isAbsolute) {
290
+ if (tail.length > 0) return `${device}\\${tail}`;
291
+ else return `${device}\\`;
292
+ } else if (tail.length > 0) {
293
+ return device + tail;
294
+ } else {
295
+ return device;
296
+ }
297
+ }
298
+
299
+ /**
300
+ * Verifies whether path is absolute
301
+ * @param path to verify
302
+ */
303
+ export function isAbsolute(path: string): boolean {
304
+ assertPath(path);
305
+ const len = path.length;
306
+ if (len === 0) return false;
307
+
308
+ const code = path.charCodeAt(0);
309
+ if (isPathSeparator(code)) {
310
+ return true;
311
+ } else if (isWindowsDeviceRoot(code)) {
312
+ // Possible device root
313
+
314
+ if (len > 2 && path.charCodeAt(1) === CHAR_COLON) {
315
+ if (isPathSeparator(path.charCodeAt(2))) return true;
316
+ }
317
+ }
318
+ return false;
319
+ }
320
+
321
+ /**
322
+ * Join all given a sequence of `paths`,then normalizes the resulting path.
323
+ * @param paths to be joined and normalized
324
+ */
325
+ export function join(...paths: string[]): string {
326
+ const pathsCount = paths.length;
327
+ if (pathsCount === 0) return ".";
328
+
329
+ let joined: string | undefined;
330
+ let firstPart: string | null = null;
331
+ for (let i = 0; i < pathsCount; ++i) {
332
+ const path = paths[i];
333
+ assertPath(path);
334
+ if (path.length > 0) {
335
+ if (joined === undefined) joined = firstPart = path;
336
+ else joined += `\\${path}`;
337
+ }
338
+ }
339
+
340
+ if (joined === undefined) return ".";
341
+
342
+ // Make sure that the joined path doesn't start with two slashes, because
343
+ // normalize() will mistake it for an UNC path then.
344
+ //
345
+ // This step is skipped when it is very clear that the user actually
346
+ // intended to point at an UNC path. This is assumed when the first
347
+ // non-empty string arguments starts with exactly two slashes followed by
348
+ // at least one more non-slash character.
349
+ //
350
+ // Note that for normalize() to treat a path as an UNC path it needs to
351
+ // have at least 2 components, so we don't filter for that here.
352
+ // This means that the user can use join to construct UNC paths from
353
+ // a server name and a share name; for example:
354
+ // path.join('//server', 'share') -> '\\\\server\\share\\')
355
+ let needsReplace = true;
356
+ let slashCount = 0;
357
+ assert(firstPart != null);
358
+ if (isPathSeparator(firstPart.charCodeAt(0))) {
359
+ ++slashCount;
360
+ const firstLen = firstPart.length;
361
+ if (firstLen > 1) {
362
+ if (isPathSeparator(firstPart.charCodeAt(1))) {
363
+ ++slashCount;
364
+ if (firstLen > 2) {
365
+ if (isPathSeparator(firstPart.charCodeAt(2))) ++slashCount;
366
+ else {
367
+ // We matched a UNC path in the first part
368
+ needsReplace = false;
369
+ }
370
+ }
371
+ }
372
+ }
373
+ }
374
+ if (needsReplace) {
375
+ // Find any more consecutive slashes we need to replace
376
+ for (; slashCount < joined.length; ++slashCount) {
377
+ if (!isPathSeparator(joined.charCodeAt(slashCount))) break;
378
+ }
379
+
380
+ // Replace the slashes if needed
381
+ if (slashCount >= 2) joined = `\\${joined.slice(slashCount)}`;
382
+ }
383
+
384
+ return normalize(joined);
385
+ }
386
+
387
+ /**
388
+ * It will solve the relative path from `from` to `to`, for instance:
389
+ * from = 'C:\\orandea\\test\\aaa'
390
+ * to = 'C:\\orandea\\impl\\bbb'
391
+ * The output of the function should be: '..\\..\\impl\\bbb'
392
+ * @param from relative path
393
+ * @param to relative path
394
+ */
395
+ export function relative(from: string, to: string): string {
396
+ assertPath(from);
397
+ assertPath(to);
398
+
399
+ if (from === to) return "";
400
+
401
+ const fromOrig = resolve(from);
402
+ const toOrig = resolve(to);
403
+
404
+ if (fromOrig === toOrig) return "";
405
+
406
+ from = fromOrig.toLowerCase();
407
+ to = toOrig.toLowerCase();
408
+
409
+ if (from === to) return "";
410
+
411
+ // Trim any leading backslashes
412
+ let fromStart = 0;
413
+ let fromEnd = from.length;
414
+ for (; fromStart < fromEnd; ++fromStart) {
415
+ if (from.charCodeAt(fromStart) !== CHAR_BACKWARD_SLASH) break;
416
+ }
417
+ // Trim trailing backslashes (applicable to UNC paths only)
418
+ for (; fromEnd - 1 > fromStart; --fromEnd) {
419
+ if (from.charCodeAt(fromEnd - 1) !== CHAR_BACKWARD_SLASH) break;
420
+ }
421
+ const fromLen = fromEnd - fromStart;
422
+
423
+ // Trim any leading backslashes
424
+ let toStart = 0;
425
+ let toEnd = to.length;
426
+ for (; toStart < toEnd; ++toStart) {
427
+ if (to.charCodeAt(toStart) !== CHAR_BACKWARD_SLASH) break;
428
+ }
429
+ // Trim trailing backslashes (applicable to UNC paths only)
430
+ for (; toEnd - 1 > toStart; --toEnd) {
431
+ if (to.charCodeAt(toEnd - 1) !== CHAR_BACKWARD_SLASH) break;
432
+ }
433
+ const toLen = toEnd - toStart;
434
+
435
+ // Compare paths to find the longest common path from root
436
+ const length = fromLen < toLen ? fromLen : toLen;
437
+ let lastCommonSep = -1;
438
+ let i = 0;
439
+ for (; i <= length; ++i) {
440
+ if (i === length) {
441
+ if (toLen > length) {
442
+ if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {
443
+ // We get here if `from` is the exact base path for `to`.
444
+ // For example: from='C:\\foo\\bar'; to='C:\\foo\\bar\\baz'
445
+ return toOrig.slice(toStart + i + 1);
446
+ } else if (i === 2) {
447
+ // We get here if `from` is the device root.
448
+ // For example: from='C:\\'; to='C:\\foo'
449
+ return toOrig.slice(toStart + i);
450
+ }
451
+ }
452
+ if (fromLen > length) {
453
+ if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {
454
+ // We get here if `to` is the exact base path for `from`.
455
+ // For example: from='C:\\foo\\bar'; to='C:\\foo'
456
+ lastCommonSep = i;
457
+ } else if (i === 2) {
458
+ // We get here if `to` is the device root.
459
+ // For example: from='C:\\foo\\bar'; to='C:\\'
460
+ lastCommonSep = 3;
461
+ }
462
+ }
463
+ break;
464
+ }
465
+ const fromCode = from.charCodeAt(fromStart + i);
466
+ const toCode = to.charCodeAt(toStart + i);
467
+ if (fromCode !== toCode) break;
468
+ else if (fromCode === CHAR_BACKWARD_SLASH) lastCommonSep = i;
469
+ }
470
+
471
+ // We found a mismatch before the first common path separator was seen, so
472
+ // return the original `to`.
473
+ if (i !== length && lastCommonSep === -1) {
474
+ return toOrig;
475
+ }
476
+
477
+ let out = "";
478
+ if (lastCommonSep === -1) lastCommonSep = 0;
479
+ // Generate the relative path based on the path difference between `to` and
480
+ // `from`
481
+ for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
482
+ if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) {
483
+ if (out.length === 0) out += "..";
484
+ else out += "\\..";
485
+ }
486
+ }
487
+
488
+ // Lastly, append the rest of the destination (`to`) path that comes after
489
+ // the common path parts
490
+ if (out.length > 0) {
491
+ return out + toOrig.slice(toStart + lastCommonSep, toEnd);
492
+ } else {
493
+ toStart += lastCommonSep;
494
+ if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) ++toStart;
495
+ return toOrig.slice(toStart, toEnd);
496
+ }
497
+ }
498
+
499
+ /**
500
+ * Resolves path to a namespace path
501
+ * @param path to resolve to namespace
502
+ */
503
+ export function toNamespacedPath(path: string): string {
504
+ // Note: this will *probably* throw somewhere.
505
+ if (typeof path !== "string") return path;
506
+ if (path.length === 0) return "";
507
+
508
+ const resolvedPath = resolve(path);
509
+
510
+ if (resolvedPath.length >= 3) {
511
+ if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) {
512
+ // Possible UNC root
513
+
514
+ if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) {
515
+ const code = resolvedPath.charCodeAt(2);
516
+ if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) {
517
+ // Matched non-long UNC root, convert the path to a long UNC path
518
+ return `\\\\?\\UNC\\${resolvedPath.slice(2)}`;
519
+ }
520
+ }
521
+ } else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0))) {
522
+ // Possible device root
523
+
524
+ if (
525
+ resolvedPath.charCodeAt(1) === CHAR_COLON &&
526
+ resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH
527
+ ) {
528
+ // Matched device root, convert the path to a long UNC path
529
+ return `\\\\?\\${resolvedPath}`;
530
+ }
531
+ }
532
+ }
533
+
534
+ return path;
535
+ }
536
+
537
+ /**
538
+ * Return the directory name of a `path`.
539
+ * @param path to determine name for
540
+ */
541
+ export function dirname(path: string): string {
542
+ assertPath(path);
543
+ const len = path.length;
544
+ if (len === 0) return ".";
545
+ let rootEnd = -1;
546
+ let end = -1;
547
+ let matchedSlash = true;
548
+ let offset = 0;
549
+ const code = path.charCodeAt(0);
550
+
551
+ // Try to match a root
552
+ if (len > 1) {
553
+ if (isPathSeparator(code)) {
554
+ // Possible UNC root
555
+
556
+ rootEnd = offset = 1;
557
+
558
+ if (isPathSeparator(path.charCodeAt(1))) {
559
+ // Matched double path separator at beginning
560
+ let j = 2;
561
+ let last = j;
562
+ // Match 1 or more non-path separators
563
+ for (; j < len; ++j) {
564
+ if (isPathSeparator(path.charCodeAt(j))) break;
565
+ }
566
+ if (j < len && j !== last) {
567
+ // Matched!
568
+ last = j;
569
+ // Match 1 or more path separators
570
+ for (; j < len; ++j) {
571
+ if (!isPathSeparator(path.charCodeAt(j))) break;
572
+ }
573
+ if (j < len && j !== last) {
574
+ // Matched!
575
+ last = j;
576
+ // Match 1 or more non-path separators
577
+ for (; j < len; ++j) {
578
+ if (isPathSeparator(path.charCodeAt(j))) break;
579
+ }
580
+ if (j === len) {
581
+ // We matched a UNC root only
582
+ return path;
583
+ }
584
+ if (j !== last) {
585
+ // We matched a UNC root with leftovers
586
+
587
+ // Offset by 1 to include the separator after the UNC root to
588
+ // treat it as a "normal root" on top of a (UNC) root
589
+ rootEnd = offset = j + 1;
590
+ }
591
+ }
592
+ }
593
+ }
594
+ } else if (isWindowsDeviceRoot(code)) {
595
+ // Possible device root
596
+
597
+ if (path.charCodeAt(1) === CHAR_COLON) {
598
+ rootEnd = offset = 2;
599
+ if (len > 2) {
600
+ if (isPathSeparator(path.charCodeAt(2))) rootEnd = offset = 3;
601
+ }
602
+ }
603
+ }
604
+ } else if (isPathSeparator(code)) {
605
+ // `path` contains just a path separator, exit early to avoid
606
+ // unnecessary work
607
+ return path;
608
+ }
609
+
610
+ for (let i = len - 1; i >= offset; --i) {
611
+ if (isPathSeparator(path.charCodeAt(i))) {
612
+ if (!matchedSlash) {
613
+ end = i;
614
+ break;
615
+ }
616
+ } else {
617
+ // We saw the first non-path separator
618
+ matchedSlash = false;
619
+ }
620
+ }
621
+
622
+ if (end === -1) {
623
+ if (rootEnd === -1) return ".";
624
+ else end = rootEnd;
625
+ }
626
+ return path.slice(0, end);
627
+ }
628
+
629
+ /**
630
+ * Return the last portion of a `path`. Trailing directory separators are ignored.
631
+ * @param path to process
632
+ * @param ext of path directory
633
+ */
634
+ export function basename(path: string, ext = ""): string {
635
+ if (ext !== undefined && typeof ext !== "string") {
636
+ throw new TypeError('"ext" argument must be a string');
637
+ }
638
+
639
+ assertPath(path);
640
+
641
+ let start = 0;
642
+ let end = -1;
643
+ let matchedSlash = true;
644
+ let i: number;
645
+
646
+ // Check for a drive letter prefix so as not to mistake the following
647
+ // path separator as an extra separator at the end of the path that can be
648
+ // disregarded
649
+ if (path.length >= 2) {
650
+ const drive = path.charCodeAt(0);
651
+ if (isWindowsDeviceRoot(drive)) {
652
+ if (path.charCodeAt(1) === CHAR_COLON) start = 2;
653
+ }
654
+ }
655
+
656
+ if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {
657
+ if (ext.length === path.length && ext === path) return "";
658
+ let extIdx = ext.length - 1;
659
+ let firstNonSlashEnd = -1;
660
+ for (i = path.length - 1; i >= start; --i) {
661
+ const code = path.charCodeAt(i);
662
+ if (isPathSeparator(code)) {
663
+ // If we reached a path separator that was not part of a set of path
664
+ // separators at the end of the string, stop now
665
+ if (!matchedSlash) {
666
+ start = i + 1;
667
+ break;
668
+ }
669
+ } else {
670
+ if (firstNonSlashEnd === -1) {
671
+ // We saw the first non-path separator, remember this index in case
672
+ // we need it if the extension ends up not matching
673
+ matchedSlash = false;
674
+ firstNonSlashEnd = i + 1;
675
+ }
676
+ if (extIdx >= 0) {
677
+ // Try to match the explicit extension
678
+ if (code === ext.charCodeAt(extIdx)) {
679
+ if (--extIdx === -1) {
680
+ // We matched the extension, so mark this as the end of our path
681
+ // component
682
+ end = i;
683
+ }
684
+ } else {
685
+ // Extension does not match, so our result is the entire path
686
+ // component
687
+ extIdx = -1;
688
+ end = firstNonSlashEnd;
689
+ }
690
+ }
691
+ }
692
+ }
693
+
694
+ if (start === end) end = firstNonSlashEnd;
695
+ else if (end === -1) end = path.length;
696
+ return path.slice(start, end);
697
+ } else {
698
+ for (i = path.length - 1; i >= start; --i) {
699
+ if (isPathSeparator(path.charCodeAt(i))) {
700
+ // If we reached a path separator that was not part of a set of path
701
+ // separators at the end of the string, stop now
702
+ if (!matchedSlash) {
703
+ start = i + 1;
704
+ break;
705
+ }
706
+ } else if (end === -1) {
707
+ // We saw the first non-path separator, mark this as the end of our
708
+ // path component
709
+ matchedSlash = false;
710
+ end = i + 1;
711
+ }
712
+ }
713
+
714
+ if (end === -1) return "";
715
+ return path.slice(start, end);
716
+ }
717
+ }
718
+
719
+ /**
720
+ * Return the extension of the `path`.
721
+ * @param path with extension
722
+ */
723
+ export function extname(path: string): string {
724
+ assertPath(path);
725
+ let start = 0;
726
+ let startDot = -1;
727
+ let startPart = 0;
728
+ let end = -1;
729
+ let matchedSlash = true;
730
+ // Track the state of characters (if any) we see before our first dot and
731
+ // after any path separator we find
732
+ let preDotState = 0;
733
+
734
+ // Check for a drive letter prefix so as not to mistake the following
735
+ // path separator as an extra separator at the end of the path that can be
736
+ // disregarded
737
+
738
+ if (
739
+ path.length >= 2 &&
740
+ path.charCodeAt(1) === CHAR_COLON &&
741
+ isWindowsDeviceRoot(path.charCodeAt(0))
742
+ ) {
743
+ start = startPart = 2;
744
+ }
745
+
746
+ for (let i = path.length - 1; i >= start; --i) {
747
+ const code = path.charCodeAt(i);
748
+ if (isPathSeparator(code)) {
749
+ // If we reached a path separator that was not part of a set of path
750
+ // separators at the end of the string, stop now
751
+ if (!matchedSlash) {
752
+ startPart = i + 1;
753
+ break;
754
+ }
755
+ continue;
756
+ }
757
+ if (end === -1) {
758
+ // We saw the first non-path separator, mark this as the end of our
759
+ // extension
760
+ matchedSlash = false;
761
+ end = i + 1;
762
+ }
763
+ if (code === CHAR_DOT) {
764
+ // If this is our first dot, mark it as the start of our extension
765
+ if (startDot === -1) startDot = i;
766
+ else if (preDotState !== 1) preDotState = 1;
767
+ } else if (startDot !== -1) {
768
+ // We saw a non-dot and non-path separator before our dot, so we should
769
+ // have a good chance at having a non-empty extension
770
+ preDotState = -1;
771
+ }
772
+ }
773
+
774
+ if (
775
+ startDot === -1 ||
776
+ end === -1 ||
777
+ // We saw a non-dot character immediately before the dot
778
+ preDotState === 0 ||
779
+ // The (right-most) trimmed path component is exactly '..'
780
+ (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)
781
+ ) {
782
+ return "";
783
+ }
784
+ return path.slice(startDot, end);
785
+ }
786
+
787
+ /**
788
+ * Generate a path from `FormatInputPathObject` object.
789
+ * @param pathObject with path
790
+ */
791
+ export function format(pathObject: FormatInputPathObject): string {
792
+ if (pathObject === null || typeof pathObject !== "object") {
793
+ throw new TypeError(
794
+ `The "pathObject" argument must be of type Object. Received type ${typeof pathObject}`,
795
+ );
796
+ }
797
+ return _format("\\", pathObject);
798
+ }
799
+
800
+ /**
801
+ * Return a `ParsedPath` object of the `path`.
802
+ * @param path to process
803
+ */
804
+ export function parse(path: string): ParsedPath {
805
+ assertPath(path);
806
+
807
+ const ret: ParsedPath = { root: "", dir: "", base: "", ext: "", name: "" };
808
+
809
+ const len = path.length;
810
+ if (len === 0) return ret;
811
+
812
+ let rootEnd = 0;
813
+ let code = path.charCodeAt(0);
814
+
815
+ // Try to match a root
816
+ if (len > 1) {
817
+ if (isPathSeparator(code)) {
818
+ // Possible UNC root
819
+
820
+ rootEnd = 1;
821
+ if (isPathSeparator(path.charCodeAt(1))) {
822
+ // Matched double path separator at beginning
823
+ let j = 2;
824
+ let last = j;
825
+ // Match 1 or more non-path separators
826
+ for (; j < len; ++j) {
827
+ if (isPathSeparator(path.charCodeAt(j))) break;
828
+ }
829
+ if (j < len && j !== last) {
830
+ // Matched!
831
+ last = j;
832
+ // Match 1 or more path separators
833
+ for (; j < len; ++j) {
834
+ if (!isPathSeparator(path.charCodeAt(j))) break;
835
+ }
836
+ if (j < len && j !== last) {
837
+ // Matched!
838
+ last = j;
839
+ // Match 1 or more non-path separators
840
+ for (; j < len; ++j) {
841
+ if (isPathSeparator(path.charCodeAt(j))) break;
842
+ }
843
+ if (j === len) {
844
+ // We matched a UNC root only
845
+
846
+ rootEnd = j;
847
+ } else if (j !== last) {
848
+ // We matched a UNC root with leftovers
849
+
850
+ rootEnd = j + 1;
851
+ }
852
+ }
853
+ }
854
+ }
855
+ } else if (isWindowsDeviceRoot(code)) {
856
+ // Possible device root
857
+
858
+ if (path.charCodeAt(1) === CHAR_COLON) {
859
+ rootEnd = 2;
860
+ if (len > 2) {
861
+ if (isPathSeparator(path.charCodeAt(2))) {
862
+ if (len === 3) {
863
+ // `path` contains just a drive root, exit early to avoid
864
+ // unnecessary work
865
+ ret.root = ret.dir = path;
866
+ return ret;
867
+ }
868
+ rootEnd = 3;
869
+ }
870
+ } else {
871
+ // `path` contains just a drive root, exit early to avoid
872
+ // unnecessary work
873
+ ret.root = ret.dir = path;
874
+ return ret;
875
+ }
876
+ }
877
+ }
878
+ } else if (isPathSeparator(code)) {
879
+ // `path` contains just a path separator, exit early to avoid
880
+ // unnecessary work
881
+ ret.root = ret.dir = path;
882
+ return ret;
883
+ }
884
+
885
+ if (rootEnd > 0) ret.root = path.slice(0, rootEnd);
886
+
887
+ let startDot = -1;
888
+ let startPart = rootEnd;
889
+ let end = -1;
890
+ let matchedSlash = true;
891
+ let i = path.length - 1;
892
+
893
+ // Track the state of characters (if any) we see before our first dot and
894
+ // after any path separator we find
895
+ let preDotState = 0;
896
+
897
+ // Get non-dir info
898
+ for (; i >= rootEnd; --i) {
899
+ code = path.charCodeAt(i);
900
+ if (isPathSeparator(code)) {
901
+ // If we reached a path separator that was not part of a set of path
902
+ // separators at the end of the string, stop now
903
+ if (!matchedSlash) {
904
+ startPart = i + 1;
905
+ break;
906
+ }
907
+ continue;
908
+ }
909
+ if (end === -1) {
910
+ // We saw the first non-path separator, mark this as the end of our
911
+ // extension
912
+ matchedSlash = false;
913
+ end = i + 1;
914
+ }
915
+ if (code === CHAR_DOT) {
916
+ // If this is our first dot, mark it as the start of our extension
917
+ if (startDot === -1) startDot = i;
918
+ else if (preDotState !== 1) preDotState = 1;
919
+ } else if (startDot !== -1) {
920
+ // We saw a non-dot and non-path separator before our dot, so we should
921
+ // have a good chance at having a non-empty extension
922
+ preDotState = -1;
923
+ }
924
+ }
925
+
926
+ if (
927
+ startDot === -1 ||
928
+ end === -1 ||
929
+ // We saw a non-dot character immediately before the dot
930
+ preDotState === 0 ||
931
+ // The (right-most) trimmed path component is exactly '..'
932
+ (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)
933
+ ) {
934
+ if (end !== -1) {
935
+ ret.base = ret.name = path.slice(startPart, end);
936
+ }
937
+ } else {
938
+ ret.name = path.slice(startPart, startDot);
939
+ ret.base = path.slice(startPart, end);
940
+ ret.ext = path.slice(startDot, end);
941
+ }
942
+
943
+ // If the directory is the root, use the entire root as the `dir` including
944
+ // the trailing slash if any (`C:\abc` -> `C:\`). Otherwise, strip out the
945
+ // trailing slash (`C:\abc\def` -> `C:\abc`).
946
+ if (startPart > 0 && startPart !== rootEnd) {
947
+ ret.dir = path.slice(0, startPart - 1);
948
+ } else ret.dir = ret.root;
949
+
950
+ return ret;
951
+ }
952
+
953
+ /**
954
+ * Converts a file URL to a path string.
955
+ *
956
+ * fromFileUrl("file:///home/foo"); // "\\home\\foo"
957
+ * fromFileUrl("file:///C:/Users/foo"); // "C:\\Users\\foo"
958
+ * fromFileUrl("file://localhost/home/foo"); // "\\\\localhost\\home\\foo"
959
+ * @param url of a file URL
960
+ */
961
+ export function fromFileUrl(url: string | URL): string {
962
+ url = url instanceof URL ? url : new URL(url);
963
+ if (url.protocol != "file:") {
964
+ throw new TypeError("Must be a file URL.");
965
+ }
966
+ let path = decodeURIComponent(
967
+ url.pathname.replace(/\//g, "\\").replace(/%(?![0-9A-Fa-f]{2})/g, "%25"),
968
+ ).replace(/^\\*([A-Za-z]:)(\\|$)/, "$1\\");
969
+ if (url.hostname != "") {
970
+ // Note: The `URL` implementation guarantees that the drive letter and
971
+ // hostname are mutually exclusive. Otherwise it would not have been valid
972
+ // to append the hostname and path like this.
973
+ path = `\\\\${url.hostname}${path}`;
974
+ }
975
+ return path;
976
+ }
977
+
978
+ /**
979
+ * Converts a path string to a file URL.
980
+ *
981
+ * toFileUrl("\\home\\foo"); // new URL("file:///home/foo")
982
+ * toFileUrl("C:\\Users\\foo"); // new URL("file:///C:/Users/foo")
983
+ * toFileUrl("\\\\127.0.0.1\\home\\foo"); // new URL("file://127.0.0.1/home/foo")
984
+ * @param path to convert to file URL
985
+ */
986
+ export function toFileUrl(path: string): URL {
987
+ if (!isAbsolute(path)) {
988
+ throw new TypeError("Must be an absolute path.");
989
+ }
990
+ const [, hostname, pathname] = path.match(
991
+ /^(?:[/\\]{2}([^/\\]+)(?=[/\\](?:[^/\\]|$)))?(.*)/,
992
+ )!;
993
+ const url = new URL("file:///");
994
+ url.pathname = encodeWhitespace(pathname.replace(/%/g, "%25"));
995
+ if (hostname != null && hostname != "localhost") {
996
+ url.hostname = hostname;
997
+ if (!url.hostname) {
998
+ throw new TypeError("Invalid hostname.");
999
+ }
1000
+ }
1001
+ return url;
1002
+ }
.deno/deps/https/deno.land/4e07f5fc21ab1b67b23874d4aec7875cfe6150e248d2e7676c7fad62ad05152b.metadata.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "headers": {
3
+ "access-control-allow-origin": "*",
4
+ "content-type": "application/typescript; charset=utf-8",
5
+ "cross-origin-resource-policy": "same-origin",
6
+ "age": "28100052",
7
+ "date": "Tue, 25 Oct 2022 11:24:44 GMT",
8
+ "server-timing": "fetchSource;dur=10",
9
+ "cross-origin-embedder-policy": "same-origin",
10
+ "accept-ranges": "bytes",
11
+ "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
12
+ "cross-origin-opener-policy": "same-origin",
13
+ "vary": "Accept-Encoding, Origin",
14
+ "x-amz-cf-id": "ySfnQL_9gGoKFrX7xQr8iErK8jF0_OWOabSiMdfrU_jRFS5BQ4o3LQ==",
15
+ "etag": "\"8cd6375845bd2e2a3e4f627d07498817\"",
16
+ "x-amz-replication-status": "FAILED",
17
+ "server": "deno/gcp-us-west1",
18
+ "content-length": "29833",
19
+ "via": "http/2 edgeproxy-h",
20
+ "x-content-type-options": "nosniff",
21
+ "x-cache": "Hit from cloudfront",
22
+ "x-amz-version-id": "agrN.hZVQQKbgItsLNJrIYyJITX11fCa",
23
+ "x-frame-options": "DENY",
24
+ "last-modified": "Fri, 02 Apr 2021 05:03:20 GMT",
25
+ "cache-control": "public, max-age=31536000, immutable",
26
+ "referrer-policy": "strict-origin-when-cross-origin",
27
+ "strict-transport-security": "max-age=63072000; includeSubDomains; preload",
28
+ "x-amz-cf-pop": "SEA73-P3"
29
+ },
30
+ "url": "https://deno.land/std@0.92.0/path/win32.ts",
31
+ "now": {
32
+ "secs_since_epoch": 1694797135,
33
+ "nanos_since_epoch": 897440827
34
+ }
35
+ }
.deno/deps/https/deno.land/59e46148ccca57c14d2755561933862de4647177b1493b50d6963147427f5e11 ADDED
@@ -0,0 +1,504 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright the Browserify authors. MIT License.
2
+ // Ported from https://github.com/browserify/path-browserify/
3
+ // This module is browser compatible.
4
+
5
+ import type { FormatInputPathObject, ParsedPath } from "./_interface.ts";
6
+ import { CHAR_DOT, CHAR_FORWARD_SLASH } from "./_constants.ts";
7
+
8
+ import {
9
+ _format,
10
+ assertPath,
11
+ isPosixPathSeparator,
12
+ normalizeString,
13
+ } from "./_util.ts";
14
+
15
+ export const sep = "/";
16
+ export const delimiter = ":";
17
+
18
+ // path.resolve([from ...], to)
19
+ /**
20
+ * Resolves `pathSegments` into an absolute path.
21
+ * @param pathSegments an array of path segments
22
+ */
23
+ export function resolve(...pathSegments: string[]): string {
24
+ let resolvedPath = "";
25
+ let resolvedAbsolute = false;
26
+
27
+ for (let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
28
+ let path: string;
29
+
30
+ if (i >= 0) path = pathSegments[i];
31
+ else {
32
+ if (globalThis.Deno == null) {
33
+ throw new TypeError("Resolved a relative path without a CWD.");
34
+ }
35
+ path = Deno.cwd();
36
+ }
37
+
38
+ assertPath(path);
39
+
40
+ // Skip empty entries
41
+ if (path.length === 0) {
42
+ continue;
43
+ }
44
+
45
+ resolvedPath = `${path}/${resolvedPath}`;
46
+ resolvedAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;
47
+ }
48
+
49
+ // At this point the path should be resolved to a full absolute path, but
50
+ // handle relative paths to be safe (might happen when process.cwd() fails)
51
+
52
+ // Normalize the path
53
+ resolvedPath = normalizeString(
54
+ resolvedPath,
55
+ !resolvedAbsolute,
56
+ "/",
57
+ isPosixPathSeparator,
58
+ );
59
+
60
+ if (resolvedAbsolute) {
61
+ if (resolvedPath.length > 0) return `/${resolvedPath}`;
62
+ else return "/";
63
+ } else if (resolvedPath.length > 0) return resolvedPath;
64
+ else return ".";
65
+ }
66
+
67
+ /**
68
+ * Normalize the `path`, resolving `'..'` and `'.'` segments.
69
+ * @param path to be normalized
70
+ */
71
+ export function normalize(path: string): string {
72
+ assertPath(path);
73
+
74
+ if (path.length === 0) return ".";
75
+
76
+ const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;
77
+ const trailingSeparator =
78
+ path.charCodeAt(path.length - 1) === CHAR_FORWARD_SLASH;
79
+
80
+ // Normalize the path
81
+ path = normalizeString(path, !isAbsolute, "/", isPosixPathSeparator);
82
+
83
+ if (path.length === 0 && !isAbsolute) path = ".";
84
+ if (path.length > 0 && trailingSeparator) path += "/";
85
+
86
+ if (isAbsolute) return `/${path}`;
87
+ return path;
88
+ }
89
+
90
+ /**
91
+ * Verifies whether provided path is absolute
92
+ * @param path to be verified as absolute
93
+ */
94
+ export function isAbsolute(path: string): boolean {
95
+ assertPath(path);
96
+ return path.length > 0 && path.charCodeAt(0) === CHAR_FORWARD_SLASH;
97
+ }
98
+
99
+ /**
100
+ * Join all given a sequence of `paths`,then normalizes the resulting path.
101
+ * @param paths to be joined and normalized
102
+ */
103
+ export function join(...paths: string[]): string {
104
+ if (paths.length === 0) return ".";
105
+ let joined: string | undefined;
106
+ for (let i = 0, len = paths.length; i < len; ++i) {
107
+ const path = paths[i];
108
+ assertPath(path);
109
+ if (path.length > 0) {
110
+ if (!joined) joined = path;
111
+ else joined += `/${path}`;
112
+ }
113
+ }
114
+ if (!joined) return ".";
115
+ return normalize(joined);
116
+ }
117
+
118
+ /**
119
+ * Return the relative path from `from` to `to` based on current working directory.
120
+ * @param from path in current working directory
121
+ * @param to path in current working directory
122
+ */
123
+ export function relative(from: string, to: string): string {
124
+ assertPath(from);
125
+ assertPath(to);
126
+
127
+ if (from === to) return "";
128
+
129
+ from = resolve(from);
130
+ to = resolve(to);
131
+
132
+ if (from === to) return "";
133
+
134
+ // Trim any leading backslashes
135
+ let fromStart = 1;
136
+ const fromEnd = from.length;
137
+ for (; fromStart < fromEnd; ++fromStart) {
138
+ if (from.charCodeAt(fromStart) !== CHAR_FORWARD_SLASH) break;
139
+ }
140
+ const fromLen = fromEnd - fromStart;
141
+
142
+ // Trim any leading backslashes
143
+ let toStart = 1;
144
+ const toEnd = to.length;
145
+ for (; toStart < toEnd; ++toStart) {
146
+ if (to.charCodeAt(toStart) !== CHAR_FORWARD_SLASH) break;
147
+ }
148
+ const toLen = toEnd - toStart;
149
+
150
+ // Compare paths to find the longest common path from root
151
+ const length = fromLen < toLen ? fromLen : toLen;
152
+ let lastCommonSep = -1;
153
+ let i = 0;
154
+ for (; i <= length; ++i) {
155
+ if (i === length) {
156
+ if (toLen > length) {
157
+ if (to.charCodeAt(toStart + i) === CHAR_FORWARD_SLASH) {
158
+ // We get here if `from` is the exact base path for `to`.
159
+ // For example: from='/foo/bar'; to='/foo/bar/baz'
160
+ return to.slice(toStart + i + 1);
161
+ } else if (i === 0) {
162
+ // We get here if `from` is the root
163
+ // For example: from='/'; to='/foo'
164
+ return to.slice(toStart + i);
165
+ }
166
+ } else if (fromLen > length) {
167
+ if (from.charCodeAt(fromStart + i) === CHAR_FORWARD_SLASH) {
168
+ // We get here if `to` is the exact base path for `from`.
169
+ // For example: from='/foo/bar/baz'; to='/foo/bar'
170
+ lastCommonSep = i;
171
+ } else if (i === 0) {
172
+ // We get here if `to` is the root.
173
+ // For example: from='/foo'; to='/'
174
+ lastCommonSep = 0;
175
+ }
176
+ }
177
+ break;
178
+ }
179
+ const fromCode = from.charCodeAt(fromStart + i);
180
+ const toCode = to.charCodeAt(toStart + i);
181
+ if (fromCode !== toCode) break;
182
+ else if (fromCode === CHAR_FORWARD_SLASH) lastCommonSep = i;
183
+ }
184
+
185
+ let out = "";
186
+ // Generate the relative path based on the path difference between `to`
187
+ // and `from`
188
+ for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
189
+ if (i === fromEnd || from.charCodeAt(i) === CHAR_FORWARD_SLASH) {
190
+ if (out.length === 0) out += "..";
191
+ else out += "/..";
192
+ }
193
+ }
194
+
195
+ // Lastly, append the rest of the destination (`to`) path that comes after
196
+ // the common path parts
197
+ if (out.length > 0) return out + to.slice(toStart + lastCommonSep);
198
+ else {
199
+ toStart += lastCommonSep;
200
+ if (to.charCodeAt(toStart) === CHAR_FORWARD_SLASH) ++toStart;
201
+ return to.slice(toStart);
202
+ }
203
+ }
204
+
205
+ /**
206
+ * Resolves path to a namespace path
207
+ * @param path to resolve to namespace
208
+ */
209
+ export function toNamespacedPath(path: string): string {
210
+ // Non-op on posix systems
211
+ return path;
212
+ }
213
+
214
+ /**
215
+ * Return the directory name of a `path`.
216
+ * @param path to determine name for
217
+ */
218
+ export function dirname(path: string): string {
219
+ assertPath(path);
220
+ if (path.length === 0) return ".";
221
+ const hasRoot = path.charCodeAt(0) === CHAR_FORWARD_SLASH;
222
+ let end = -1;
223
+ let matchedSlash = true;
224
+ for (let i = path.length - 1; i >= 1; --i) {
225
+ if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) {
226
+ if (!matchedSlash) {
227
+ end = i;
228
+ break;
229
+ }
230
+ } else {
231
+ // We saw the first non-path separator
232
+ matchedSlash = false;
233
+ }
234
+ }
235
+
236
+ if (end === -1) return hasRoot ? "/" : ".";
237
+ if (hasRoot && end === 1) return "//";
238
+ return path.slice(0, end);
239
+ }
240
+
241
+ /**
242
+ * Return the last portion of a `path`. Trailing directory separators are ignored.
243
+ * @param path to process
244
+ * @param ext of path directory
245
+ */
246
+ export function basename(path: string, ext = ""): string {
247
+ if (ext !== undefined && typeof ext !== "string") {
248
+ throw new TypeError('"ext" argument must be a string');
249
+ }
250
+ assertPath(path);
251
+
252
+ let start = 0;
253
+ let end = -1;
254
+ let matchedSlash = true;
255
+ let i: number;
256
+
257
+ if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {
258
+ if (ext.length === path.length && ext === path) return "";
259
+ let extIdx = ext.length - 1;
260
+ let firstNonSlashEnd = -1;
261
+ for (i = path.length - 1; i >= 0; --i) {
262
+ const code = path.charCodeAt(i);
263
+ if (code === CHAR_FORWARD_SLASH) {
264
+ // If we reached a path separator that was not part of a set of path
265
+ // separators at the end of the string, stop now
266
+ if (!matchedSlash) {
267
+ start = i + 1;
268
+ break;
269
+ }
270
+ } else {
271
+ if (firstNonSlashEnd === -1) {
272
+ // We saw the first non-path separator, remember this index in case
273
+ // we need it if the extension ends up not matching
274
+ matchedSlash = false;
275
+ firstNonSlashEnd = i + 1;
276
+ }
277
+ if (extIdx >= 0) {
278
+ // Try to match the explicit extension
279
+ if (code === ext.charCodeAt(extIdx)) {
280
+ if (--extIdx === -1) {
281
+ // We matched the extension, so mark this as the end of our path
282
+ // component
283
+ end = i;
284
+ }
285
+ } else {
286
+ // Extension does not match, so our result is the entire path
287
+ // component
288
+ extIdx = -1;
289
+ end = firstNonSlashEnd;
290
+ }
291
+ }
292
+ }
293
+ }
294
+
295
+ if (start === end) end = firstNonSlashEnd;
296
+ else if (end === -1) end = path.length;
297
+ return path.slice(start, end);
298
+ } else {
299
+ for (i = path.length - 1; i >= 0; --i) {
300
+ if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) {
301
+ // If we reached a path separator that was not part of a set of path
302
+ // separators at the end of the string, stop now
303
+ if (!matchedSlash) {
304
+ start = i + 1;
305
+ break;
306
+ }
307
+ } else if (end === -1) {
308
+ // We saw the first non-path separator, mark this as the end of our
309
+ // path component
310
+ matchedSlash = false;
311
+ end = i + 1;
312
+ }
313
+ }
314
+
315
+ if (end === -1) return "";
316
+ return path.slice(start, end);
317
+ }
318
+ }
319
+
320
+ /**
321
+ * Return the extension of the `path`.
322
+ * @param path with extension
323
+ */
324
+ export function extname(path: string): string {
325
+ assertPath(path);
326
+ let startDot = -1;
327
+ let startPart = 0;
328
+ let end = -1;
329
+ let matchedSlash = true;
330
+ // Track the state of characters (if any) we see before our first dot and
331
+ // after any path separator we find
332
+ let preDotState = 0;
333
+ for (let i = path.length - 1; i >= 0; --i) {
334
+ const code = path.charCodeAt(i);
335
+ if (code === CHAR_FORWARD_SLASH) {
336
+ // If we reached a path separator that was not part of a set of path
337
+ // separators at the end of the string, stop now
338
+ if (!matchedSlash) {
339
+ startPart = i + 1;
340
+ break;
341
+ }
342
+ continue;
343
+ }
344
+ if (end === -1) {
345
+ // We saw the first non-path separator, mark this as the end of our
346
+ // extension
347
+ matchedSlash = false;
348
+ end = i + 1;
349
+ }
350
+ if (code === CHAR_DOT) {
351
+ // If this is our first dot, mark it as the start of our extension
352
+ if (startDot === -1) startDot = i;
353
+ else if (preDotState !== 1) preDotState = 1;
354
+ } else if (startDot !== -1) {
355
+ // We saw a non-dot and non-path separator before our dot, so we should
356
+ // have a good chance at having a non-empty extension
357
+ preDotState = -1;
358
+ }
359
+ }
360
+
361
+ if (
362
+ startDot === -1 ||
363
+ end === -1 ||
364
+ // We saw a non-dot character immediately before the dot
365
+ preDotState === 0 ||
366
+ // The (right-most) trimmed path component is exactly '..'
367
+ (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)
368
+ ) {
369
+ return "";
370
+ }
371
+ return path.slice(startDot, end);
372
+ }
373
+
374
+ /**
375
+ * Generate a path from `FormatInputPathObject` object.
376
+ * @param pathObject with path
377
+ */
378
+ export function format(pathObject: FormatInputPathObject): string {
379
+ if (pathObject === null || typeof pathObject !== "object") {
380
+ throw new TypeError(
381
+ `The "pathObject" argument must be of type Object. Received type ${typeof pathObject}`,
382
+ );
383
+ }
384
+ return _format("/", pathObject);
385
+ }
386
+
387
+ /**
388
+ * Return a `ParsedPath` object of the `path`.
389
+ * @param path to process
390
+ */
391
+ export function parse(path: string): ParsedPath {
392
+ assertPath(path);
393
+
394
+ const ret: ParsedPath = { root: "", dir: "", base: "", ext: "", name: "" };
395
+ if (path.length === 0) return ret;
396
+ const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;
397
+ let start: number;
398
+ if (isAbsolute) {
399
+ ret.root = "/";
400
+ start = 1;
401
+ } else {
402
+ start = 0;
403
+ }
404
+ let startDot = -1;
405
+ let startPart = 0;
406
+ let end = -1;
407
+ let matchedSlash = true;
408
+ let i = path.length - 1;
409
+
410
+ // Track the state of characters (if any) we see before our first dot and
411
+ // after any path separator we find
412
+ let preDotState = 0;
413
+
414
+ // Get non-dir info
415
+ for (; i >= start; --i) {
416
+ const code = path.charCodeAt(i);
417
+ if (code === CHAR_FORWARD_SLASH) {
418
+ // If we reached a path separator that was not part of a set of path
419
+ // separators at the end of the string, stop now
420
+ if (!matchedSlash) {
421
+ startPart = i + 1;
422
+ break;
423
+ }
424
+ continue;
425
+ }
426
+ if (end === -1) {
427
+ // We saw the first non-path separator, mark this as the end of our
428
+ // extension
429
+ matchedSlash = false;
430
+ end = i + 1;
431
+ }
432
+ if (code === CHAR_DOT) {
433
+ // If this is our first dot, mark it as the start of our extension
434
+ if (startDot === -1) startDot = i;
435
+ else if (preDotState !== 1) preDotState = 1;
436
+ } else if (startDot !== -1) {
437
+ // We saw a non-dot and non-path separator before our dot, so we should
438
+ // have a good chance at having a non-empty extension
439
+ preDotState = -1;
440
+ }
441
+ }
442
+
443
+ if (
444
+ startDot === -1 ||
445
+ end === -1 ||
446
+ // We saw a non-dot character immediately before the dot
447
+ preDotState === 0 ||
448
+ // The (right-most) trimmed path component is exactly '..'
449
+ (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)
450
+ ) {
451
+ if (end !== -1) {
452
+ if (startPart === 0 && isAbsolute) {
453
+ ret.base = ret.name = path.slice(1, end);
454
+ } else {
455
+ ret.base = ret.name = path.slice(startPart, end);
456
+ }
457
+ }
458
+ } else {
459
+ if (startPart === 0 && isAbsolute) {
460
+ ret.name = path.slice(1, startDot);
461
+ ret.base = path.slice(1, end);
462
+ } else {
463
+ ret.name = path.slice(startPart, startDot);
464
+ ret.base = path.slice(startPart, end);
465
+ }
466
+ ret.ext = path.slice(startDot, end);
467
+ }
468
+
469
+ if (startPart > 0) ret.dir = path.slice(0, startPart - 1);
470
+ else if (isAbsolute) ret.dir = "/";
471
+
472
+ return ret;
473
+ }
474
+
475
+ /**
476
+ * Converts a file URL to a path string.
477
+ *
478
+ * fromFileUrl("file:///home/foo"); // "/home/foo"
479
+ * @param url of a file URL
480
+ */
481
+ export function fromFileUrl(url: string | URL): string {
482
+ url = url instanceof URL ? url : new URL(url);
483
+ if (url.protocol != "file:") {
484
+ throw new TypeError("Must be a file URL.");
485
+ }
486
+ return decodeURIComponent(
487
+ url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"),
488
+ );
489
+ }
490
+
491
+ /**
492
+ * Converts a path string to a file URL.
493
+ *
494
+ * toFileUrl("/home/foo"); // new URL("file:///home/foo")
495
+ * @param path to convert to file URL
496
+ */
497
+ export function toFileUrl(path: string): URL {
498
+ if (!isAbsolute(path)) {
499
+ throw new TypeError("Must be an absolute path.");
500
+ }
501
+ const url = new URL("file:///");
502
+ url.pathname = path.replace(/%/g, "%25").replace(/\\/g, "%5C");
503
+ return url;
504
+ }
.deno/deps/https/deno.land/59e46148ccca57c14d2755561933862de4647177b1493b50d6963147427f5e11.metadata.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "headers": {
3
+ "strict-transport-security": "max-age=63072000; includeSubDomains; preload",
4
+ "vary": "Accept-Encoding, Origin",
5
+ "cache-control": "public, max-age=31536000, immutable",
6
+ "x-cache": "Hit from cloudfront",
7
+ "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
8
+ "cross-origin-resource-policy": "same-origin",
9
+ "date": "Wed, 12 Oct 2022 22:13:12 GMT",
10
+ "etag": "\"faa8d08fd063480a5c14bc1bc60e9b57\"",
11
+ "x-content-type-options": "nosniff",
12
+ "via": "http/2 edgeproxy-h",
13
+ "age": "29184345",
14
+ "content-type": "application/typescript; charset=utf-8",
15
+ "access-control-allow-origin": "*",
16
+ "cross-origin-embedder-policy": "same-origin",
17
+ "x-amz-version-id": "UPxGV9Qf1JI1wlLizoi066FkMMQXAppy",
18
+ "server": "deno/gcp-us-west1",
19
+ "x-amz-cf-pop": "SEA73-P3",
20
+ "last-modified": "Wed, 20 Jan 2021 05:26:04 GMT",
21
+ "cross-origin-opener-policy": "same-origin",
22
+ "referrer-policy": "strict-origin-when-cross-origin",
23
+ "x-amz-cf-id": "m7seaG6hYMPHHujWXUhLF3B8U9YWSyu_eAv5WuZINclEIsVSiMju-w==",
24
+ "content-length": "14572",
25
+ "accept-ranges": "bytes",
26
+ "x-frame-options": "DENY",
27
+ "x-amz-replication-status": "FAILED",
28
+ "server-timing": "fetchSource;dur=38"
29
+ },
30
+ "url": "https://deno.land/std@0.84.0/path/posix.ts",
31
+ "now": {
32
+ "secs_since_epoch": 1694797136,
33
+ "nanos_since_epoch": 682144818
34
+ }
35
+ }
.deno/deps/https/deno.land/678a5cff2d17fd224e1703f305e09ac8a2328bb71302e03665dcd871eb41c428 ADDED
@@ -0,0 +1,387 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+
4
+ import { osType } from "../_util/os.ts";
5
+ import { join, normalize } from "./mod.ts";
6
+ import { SEP, SEP_PATTERN } from "./separator.ts";
7
+
8
+ export interface GlobOptions {
9
+ /** Extended glob syntax.
10
+ * See https://www.linuxjournal.com/content/bash-extended-globbing. Defaults
11
+ * to true. */
12
+ extended?: boolean;
13
+ /** Globstar syntax.
14
+ * See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
15
+ * If false, `**` is treated like `*`. Defaults to true. */
16
+ globstar?: boolean;
17
+ /** Operating system. Defaults to the native OS. */
18
+ os?: typeof Deno.build.os;
19
+ }
20
+
21
+ export type GlobToRegExpOptions = GlobOptions;
22
+
23
+ // deno-fmt-ignore
24
+ const regExpEscapeChars = ["!", "$", "(", ")", "*", "+", ".", "=", "?", "[", "\\", "^", "{", "|"];
25
+ const rangeEscapeChars = ["-", "\\", "]"];
26
+
27
+ /** Convert a glob string to a regular expression.
28
+ *
29
+ * Tries to match bash glob expansion as closely as possible.
30
+ *
31
+ * Basic glob syntax:
32
+ * - `*` - Matches everything without leaving the path segment.
33
+ * - `{foo,bar}` - Matches `foo` or `bar`.
34
+ * - `[abcd]` - Matches `a`, `b`, `c` or `d`.
35
+ * - `[a-d]` - Matches `a`, `b`, `c` or `d`.
36
+ * - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
37
+ * - `[[:<class>:]]` - Matches any character belonging to `<class>`.
38
+ * - `[[:alnum:]]` - Matches any digit or letter.
39
+ * - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
40
+ * - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
41
+ * for a complete list of supported character classes.
42
+ * - `\` - Escapes the next character for an `os` other than `"windows"`.
43
+ * - \` - Escapes the next character for `os` set to `"windows"`.
44
+ * - `/` - Path separator.
45
+ * - `\` - Additional path separator only for `os` set to `"windows"`.
46
+ *
47
+ * Extended syntax:
48
+ * - Requires `{ extended: true }`.
49
+ * - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
50
+ * - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
51
+ * - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
52
+ * - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
53
+ * - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
54
+ * - See https://www.linuxjournal.com/content/bash-extended-globbing.
55
+ *
56
+ * Globstar syntax:
57
+ * - Requires `{ globstar: true }`.
58
+ * - `**` - Matches any number of any path segments.
59
+ * - Must comprise its entire path segment in the provided glob.
60
+ * - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
61
+ *
62
+ * Note the following properties:
63
+ * - The generated `RegExp` is anchored at both start and end.
64
+ * - Repeating and trailing separators are tolerated. Trailing separators in the
65
+ * provided glob have no meaning and are discarded.
66
+ * - Absolute globs will only match absolute paths, etc.
67
+ * - Empty globs will match nothing.
68
+ * - Any special glob syntax must be contained to one path segment. For example,
69
+ * `?(foo|bar/baz)` is invalid. The separator will take precendence and the
70
+ * first segment ends with an unclosed group.
71
+ * - If a path segment ends with unclosed groups or a dangling escape prefix, a
72
+ * parse error has occured. Every character for that segment is taken
73
+ * literally in this event.
74
+ *
75
+ * Limitations:
76
+ * - A negative group like `!(foo|bar)` will wrongly be converted to a negative
77
+ * look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
78
+ * fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
79
+ * `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
80
+ * the group occurs not nested at the end of the segment. */
81
+ export function globToRegExp(
82
+ glob: string,
83
+ { extended = true, globstar: globstarOption = true, os = osType }:
84
+ GlobToRegExpOptions = {},
85
+ ): RegExp {
86
+ if (glob == "") {
87
+ return /(?!)/;
88
+ }
89
+
90
+ const sep = os == "windows" ? "(?:\\\\|/)+" : "/+";
91
+ const sepMaybe = os == "windows" ? "(?:\\\\|/)*" : "/*";
92
+ const seps = os == "windows" ? ["\\", "/"] : ["/"];
93
+ const globstar = os == "windows"
94
+ ? "(?:[^\\\\/]*(?:\\\\|/|$)+)*"
95
+ : "(?:[^/]*(?:/|$)+)*";
96
+ const wildcard = os == "windows" ? "[^\\\\/]*" : "[^/]*";
97
+ const escapePrefix = os == "windows" ? "`" : "\\";
98
+
99
+ // Remove trailing separators.
100
+ let newLength = glob.length;
101
+ for (; newLength > 1 && seps.includes(glob[newLength - 1]); newLength--);
102
+ glob = glob.slice(0, newLength);
103
+
104
+ let regExpString = "";
105
+
106
+ // Terminates correctly. Trust that `j` is incremented every iteration.
107
+ for (let j = 0; j < glob.length;) {
108
+ let segment = "";
109
+ const groupStack = [];
110
+ let inRange = false;
111
+ let inEscape = false;
112
+ let endsWithSep = false;
113
+ let i = j;
114
+
115
+ // Terminates with `i` at the non-inclusive end of the current segment.
116
+ for (; i < glob.length && !seps.includes(glob[i]); i++) {
117
+ if (inEscape) {
118
+ inEscape = false;
119
+ const escapeChars = inRange ? rangeEscapeChars : regExpEscapeChars;
120
+ segment += escapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
121
+ continue;
122
+ }
123
+
124
+ if (glob[i] == escapePrefix) {
125
+ inEscape = true;
126
+ continue;
127
+ }
128
+
129
+ if (glob[i] == "[") {
130
+ if (!inRange) {
131
+ inRange = true;
132
+ segment += "[";
133
+ if (glob[i + 1] == "!") {
134
+ i++;
135
+ segment += "^";
136
+ } else if (glob[i + 1] == "^") {
137
+ i++;
138
+ segment += "\\^";
139
+ }
140
+ continue;
141
+ } else if (glob[i + 1] == ":") {
142
+ let k = i + 1;
143
+ let value = "";
144
+ while (glob[k + 1] != null && glob[k + 1] != ":") {
145
+ value += glob[k + 1];
146
+ k++;
147
+ }
148
+ if (glob[k + 1] == ":" && glob[k + 2] == "]") {
149
+ i = k + 2;
150
+ if (value == "alnum") segment += "\\dA-Za-z";
151
+ else if (value == "alpha") segment += "A-Za-z";
152
+ else if (value == "ascii") segment += "\x00-\x7F";
153
+ else if (value == "blank") segment += "\t ";
154
+ else if (value == "cntrl") segment += "\x00-\x1F\x7F";
155
+ else if (value == "digit") segment += "\\d";
156
+ else if (value == "graph") segment += "\x21-\x7E";
157
+ else if (value == "lower") segment += "a-z";
158
+ else if (value == "print") segment += "\x20-\x7E";
159
+ else if (value == "punct") {
160
+ segment += "!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_‘{|}~";
161
+ } else if (value == "space") segment += "\\s\v";
162
+ else if (value == "upper") segment += "A-Z";
163
+ else if (value == "word") segment += "\\w";
164
+ else if (value == "xdigit") segment += "\\dA-Fa-f";
165
+ continue;
166
+ }
167
+ }
168
+ }
169
+
170
+ if (glob[i] == "]" && inRange) {
171
+ inRange = false;
172
+ segment += "]";
173
+ continue;
174
+ }
175
+
176
+ if (inRange) {
177
+ if (glob[i] == "\\") {
178
+ segment += `\\\\`;
179
+ } else {
180
+ segment += glob[i];
181
+ }
182
+ continue;
183
+ }
184
+
185
+ if (
186
+ glob[i] == ")" && groupStack.length > 0 &&
187
+ groupStack[groupStack.length - 1] != "BRACE"
188
+ ) {
189
+ segment += ")";
190
+ const type = groupStack.pop()!;
191
+ if (type == "!") {
192
+ segment += wildcard;
193
+ } else if (type != "@") {
194
+ segment += type;
195
+ }
196
+ continue;
197
+ }
198
+
199
+ if (
200
+ glob[i] == "|" && groupStack.length > 0 &&
201
+ groupStack[groupStack.length - 1] != "BRACE"
202
+ ) {
203
+ segment += "|";
204
+ continue;
205
+ }
206
+
207
+ if (glob[i] == "+" && extended && glob[i + 1] == "(") {
208
+ i++;
209
+ groupStack.push("+");
210
+ segment += "(?:";
211
+ continue;
212
+ }
213
+
214
+ if (glob[i] == "@" && extended && glob[i + 1] == "(") {
215
+ i++;
216
+ groupStack.push("@");
217
+ segment += "(?:";
218
+ continue;
219
+ }
220
+
221
+ if (glob[i] == "?") {
222
+ if (extended && glob[i + 1] == "(") {
223
+ i++;
224
+ groupStack.push("?");
225
+ segment += "(?:";
226
+ } else {
227
+ segment += ".";
228
+ }
229
+ continue;
230
+ }
231
+
232
+ if (glob[i] == "!" && extended && glob[i + 1] == "(") {
233
+ i++;
234
+ groupStack.push("!");
235
+ segment += "(?!";
236
+ continue;
237
+ }
238
+
239
+ if (glob[i] == "{") {
240
+ groupStack.push("BRACE");
241
+ segment += "(?:";
242
+ continue;
243
+ }
244
+
245
+ if (glob[i] == "}" && groupStack[groupStack.length - 1] == "BRACE") {
246
+ groupStack.pop();
247
+ segment += ")";
248
+ continue;
249
+ }
250
+
251
+ if (glob[i] == "," && groupStack[groupStack.length - 1] == "BRACE") {
252
+ segment += "|";
253
+ continue;
254
+ }
255
+
256
+ if (glob[i] == "*") {
257
+ if (extended && glob[i + 1] == "(") {
258
+ i++;
259
+ groupStack.push("*");
260
+ segment += "(?:";
261
+ } else {
262
+ const prevChar = glob[i - 1];
263
+ let numStars = 1;
264
+ while (glob[i + 1] == "*") {
265
+ i++;
266
+ numStars++;
267
+ }
268
+ const nextChar = glob[i + 1];
269
+ if (
270
+ globstarOption && numStars == 2 &&
271
+ [...seps, undefined].includes(prevChar) &&
272
+ [...seps, undefined].includes(nextChar)
273
+ ) {
274
+ segment += globstar;
275
+ endsWithSep = true;
276
+ } else {
277
+ segment += wildcard;
278
+ }
279
+ }
280
+ continue;
281
+ }
282
+
283
+ segment += regExpEscapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
284
+ }
285
+
286
+ // Check for unclosed groups or a dangling backslash.
287
+ if (groupStack.length > 0 || inRange || inEscape) {
288
+ // Parse failure. Take all characters from this segment literally.
289
+ segment = "";
290
+ for (const c of glob.slice(j, i)) {
291
+ segment += regExpEscapeChars.includes(c) ? `\\${c}` : c;
292
+ endsWithSep = false;
293
+ }
294
+ }
295
+
296
+ regExpString += segment;
297
+ if (!endsWithSep) {
298
+ regExpString += i < glob.length ? sep : sepMaybe;
299
+ endsWithSep = true;
300
+ }
301
+
302
+ // Terminates with `i` at the start of the next segment.
303
+ while (seps.includes(glob[i])) i++;
304
+
305
+ // Check that the next value of `j` is indeed higher than the current value.
306
+ if (!(i > j)) {
307
+ throw new Error("Assertion failure: i > j (potential infinite loop)");
308
+ }
309
+ j = i;
310
+ }
311
+
312
+ regExpString = `^${regExpString}$`;
313
+ return new RegExp(regExpString);
314
+ }
315
+
316
+ /** Test whether the given string is a glob */
317
+ export function isGlob(str: string): boolean {
318
+ const chars: Record<string, string> = { "{": "}", "(": ")", "[": "]" };
319
+ const regex =
320
+ /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
321
+
322
+ if (str === "") {
323
+ return false;
324
+ }
325
+
326
+ let match: RegExpExecArray | null;
327
+
328
+ while ((match = regex.exec(str))) {
329
+ if (match[2]) return true;
330
+ let idx = match.index + match[0].length;
331
+
332
+ // if an open bracket/brace/paren is escaped,
333
+ // set the index to the next closing character
334
+ const open = match[1];
335
+ const close = open ? chars[open] : null;
336
+ if (open && close) {
337
+ const n = str.indexOf(close, idx);
338
+ if (n !== -1) {
339
+ idx = n + 1;
340
+ }
341
+ }
342
+
343
+ str = str.slice(idx);
344
+ }
345
+
346
+ return false;
347
+ }
348
+
349
+ /** Like normalize(), but doesn't collapse "**\/.." when `globstar` is true. */
350
+ export function normalizeGlob(
351
+ glob: string,
352
+ { globstar = false }: GlobOptions = {},
353
+ ): string {
354
+ if (glob.match(/\0/g)) {
355
+ throw new Error(`Glob contains invalid characters: "${glob}"`);
356
+ }
357
+ if (!globstar) {
358
+ return normalize(glob);
359
+ }
360
+ const s = SEP_PATTERN.source;
361
+ const badParentPattern = new RegExp(
362
+ `(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`,
363
+ "g",
364
+ );
365
+ return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
366
+ }
367
+
368
+ /** Like join(), but doesn't collapse "**\/.." when `globstar` is true. */
369
+ export function joinGlobs(
370
+ globs: string[],
371
+ { extended = false, globstar = false }: GlobOptions = {},
372
+ ): string {
373
+ if (!globstar || globs.length == 0) {
374
+ return join(...globs);
375
+ }
376
+ if (globs.length === 0) return ".";
377
+ let joined: string | undefined;
378
+ for (const glob of globs) {
379
+ const path = glob;
380
+ if (path.length > 0) {
381
+ if (!joined) joined = path;
382
+ else joined += `${SEP}${path}`;
383
+ }
384
+ }
385
+ if (!joined) return ".";
386
+ return normalizeGlob(joined, { extended, globstar });
387
+ }
.deno/deps/https/deno.land/678a5cff2d17fd224e1703f305e09ac8a2328bb71302e03665dcd871eb41c428.metadata.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "headers": {
3
+ "x-amz-cf-pop": "SEA73-P3",
4
+ "server-timing": "fetchSource;dur=14",
5
+ "cache-control": "public, max-age=31536000, immutable",
6
+ "x-amz-replication-status": "FAILED",
7
+ "x-frame-options": "DENY",
8
+ "x-amz-version-id": "vHtYhG1CnWUnUwNgbVRHJTKvZslqEuJH",
9
+ "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
10
+ "content-length": "12303",
11
+ "access-control-allow-origin": "*",
12
+ "server": "deno/gcp-us-west1",
13
+ "x-cache": "Hit from cloudfront",
14
+ "cross-origin-embedder-policy": "same-origin",
15
+ "date": "Fri, 28 Oct 2022 13:44:31 GMT",
16
+ "vary": "Accept-Encoding, Origin",
17
+ "x-content-type-options": "nosniff",
18
+ "last-modified": "Fri, 02 Apr 2021 05:03:20 GMT",
19
+ "cross-origin-resource-policy": "same-origin",
20
+ "strict-transport-security": "max-age=63072000; includeSubDomains; preload",
21
+ "cross-origin-opener-policy": "same-origin",
22
+ "accept-ranges": "bytes",
23
+ "age": "27832465",
24
+ "content-type": "application/typescript; charset=utf-8",
25
+ "etag": "\"caf72ec6d39c7a17de71b1d3b14fdd7d\"",
26
+ "x-amz-cf-id": "Eeeotffcemjc9CNuIuCu2oiHJVI_jYg0M4grSlYc_rNTJbcxIGltlg==",
27
+ "referrer-policy": "strict-origin-when-cross-origin",
28
+ "via": "http/2 edgeproxy-h"
29
+ },
30
+ "url": "https://deno.land/std@0.92.0/path/glob.ts",
31
+ "now": {
32
+ "secs_since_epoch": 1694797135,
33
+ "nanos_since_epoch": 856488289
34
+ }
35
+ }
.deno/deps/https/deno.land/68c0328e6ee41a9088cacf7c7ec358c0b7e757cf39291f2273f4b8d7950e2185 ADDED
@@ -0,0 +1,381 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
2
+ import { BufReader, BufWriter } from "../io/bufio.ts";
3
+ import { TextProtoReader } from "../textproto/mod.ts";
4
+ import { assert } from "../_util/assert.ts";
5
+ import { Response, ServerRequest } from "./server.ts";
6
+ import { STATUS_TEXT } from "./http_status.ts";
7
+
8
+ const encoder = new TextEncoder();
9
+
10
+ export function emptyReader(): Deno.Reader {
11
+ return {
12
+ read(_: Uint8Array): Promise<number | null> {
13
+ return Promise.resolve(null);
14
+ },
15
+ };
16
+ }
17
+
18
+ export function bodyReader(contentLength: number, r: BufReader): Deno.Reader {
19
+ let totalRead = 0;
20
+ let finished = false;
21
+ async function read(buf: Uint8Array): Promise<number | null> {
22
+ if (finished) return null;
23
+ let result: number | null;
24
+ const remaining = contentLength - totalRead;
25
+ if (remaining >= buf.byteLength) {
26
+ result = await r.read(buf);
27
+ } else {
28
+ const readBuf = buf.subarray(0, remaining);
29
+ result = await r.read(readBuf);
30
+ }
31
+ if (result !== null) {
32
+ totalRead += result;
33
+ }
34
+ finished = totalRead === contentLength;
35
+ return result;
36
+ }
37
+ return { read };
38
+ }
39
+
40
+ export function chunkedBodyReader(h: Headers, r: BufReader): Deno.Reader {
41
+ // Based on https://tools.ietf.org/html/rfc2616#section-19.4.6
42
+ const tp = new TextProtoReader(r);
43
+ let finished = false;
44
+ const chunks: Array<{
45
+ offset: number;
46
+ data: Uint8Array;
47
+ }> = [];
48
+ async function read(buf: Uint8Array): Promise<number | null> {
49
+ if (finished) return null;
50
+ const [chunk] = chunks;
51
+ if (chunk) {
52
+ const chunkRemaining = chunk.data.byteLength - chunk.offset;
53
+ const readLength = Math.min(chunkRemaining, buf.byteLength);
54
+ for (let i = 0; i < readLength; i++) {
55
+ buf[i] = chunk.data[chunk.offset + i];
56
+ }
57
+ chunk.offset += readLength;
58
+ if (chunk.offset === chunk.data.byteLength) {
59
+ chunks.shift();
60
+ // Consume \r\n;
61
+ if ((await tp.readLine()) === null) {
62
+ throw new Deno.errors.UnexpectedEof();
63
+ }
64
+ }
65
+ return readLength;
66
+ }
67
+ const line = await tp.readLine();
68
+ if (line === null) throw new Deno.errors.UnexpectedEof();
69
+ // TODO(bartlomieju): handle chunk extension
70
+ const [chunkSizeString] = line.split(";");
71
+ const chunkSize = parseInt(chunkSizeString, 16);
72
+ if (Number.isNaN(chunkSize) || chunkSize < 0) {
73
+ throw new Deno.errors.InvalidData("Invalid chunk size");
74
+ }
75
+ if (chunkSize > 0) {
76
+ if (chunkSize > buf.byteLength) {
77
+ let eof = await r.readFull(buf);
78
+ if (eof === null) {
79
+ throw new Deno.errors.UnexpectedEof();
80
+ }
81
+ const restChunk = new Uint8Array(chunkSize - buf.byteLength);
82
+ eof = await r.readFull(restChunk);
83
+ if (eof === null) {
84
+ throw new Deno.errors.UnexpectedEof();
85
+ } else {
86
+ chunks.push({
87
+ offset: 0,
88
+ data: restChunk,
89
+ });
90
+ }
91
+ return buf.byteLength;
92
+ } else {
93
+ const bufToFill = buf.subarray(0, chunkSize);
94
+ const eof = await r.readFull(bufToFill);
95
+ if (eof === null) {
96
+ throw new Deno.errors.UnexpectedEof();
97
+ }
98
+ // Consume \r\n
99
+ if ((await tp.readLine()) === null) {
100
+ throw new Deno.errors.UnexpectedEof();
101
+ }
102
+ return chunkSize;
103
+ }
104
+ } else {
105
+ assert(chunkSize === 0);
106
+ // Consume \r\n
107
+ if ((await r.readLine()) === null) {
108
+ throw new Deno.errors.UnexpectedEof();
109
+ }
110
+ await readTrailers(h, r);
111
+ finished = true;
112
+ return null;
113
+ }
114
+ }
115
+ return { read };
116
+ }
117
+
118
+ function isProhibidedForTrailer(key: string): boolean {
119
+ const s = new Set(["transfer-encoding", "content-length", "trailer"]);
120
+ return s.has(key.toLowerCase());
121
+ }
122
+
123
+ /** Read trailer headers from reader and append values to headers. "trailer"
124
+ * field will be deleted. */
125
+ export async function readTrailers(
126
+ headers: Headers,
127
+ r: BufReader,
128
+ ): Promise<void> {
129
+ const trailers = parseTrailer(headers.get("trailer"));
130
+ if (trailers == null) return;
131
+ const trailerNames = [...trailers.keys()];
132
+ const tp = new TextProtoReader(r);
133
+ const result = await tp.readMIMEHeader();
134
+ if (result == null) {
135
+ throw new Deno.errors.InvalidData("Missing trailer header.");
136
+ }
137
+ const undeclared = [...result.keys()].filter(
138
+ (k) => !trailerNames.includes(k),
139
+ );
140
+ if (undeclared.length > 0) {
141
+ throw new Deno.errors.InvalidData(
142
+ `Undeclared trailers: ${Deno.inspect(undeclared)}.`,
143
+ );
144
+ }
145
+ for (const [k, v] of result) {
146
+ headers.append(k, v);
147
+ }
148
+ const missingTrailers = trailerNames.filter((k) => !result.has(k));
149
+ if (missingTrailers.length > 0) {
150
+ throw new Deno.errors.InvalidData(
151
+ `Missing trailers: ${Deno.inspect(missingTrailers)}.`,
152
+ );
153
+ }
154
+ headers.delete("trailer");
155
+ }
156
+
157
+ function parseTrailer(field: string | null): Headers | undefined {
158
+ if (field == null) {
159
+ return undefined;
160
+ }
161
+ const trailerNames = field.split(",").map((v) => v.trim().toLowerCase());
162
+ if (trailerNames.length === 0) {
163
+ throw new Deno.errors.InvalidData("Empty trailer header.");
164
+ }
165
+ const prohibited = trailerNames.filter((k) => isProhibidedForTrailer(k));
166
+ if (prohibited.length > 0) {
167
+ throw new Deno.errors.InvalidData(
168
+ `Prohibited trailer names: ${Deno.inspect(prohibited)}.`,
169
+ );
170
+ }
171
+ return new Headers(trailerNames.map((key) => [key, ""]));
172
+ }
173
+
174
+ export async function writeChunkedBody(
175
+ w: BufWriter,
176
+ r: Deno.Reader,
177
+ ): Promise<void> {
178
+ for await (const chunk of Deno.iter(r)) {
179
+ if (chunk.byteLength <= 0) continue;
180
+ const start = encoder.encode(`${chunk.byteLength.toString(16)}\r\n`);
181
+ const end = encoder.encode("\r\n");
182
+ await w.write(start);
183
+ await w.write(chunk);
184
+ await w.write(end);
185
+ await w.flush();
186
+ }
187
+
188
+ const endChunk = encoder.encode("0\r\n\r\n");
189
+ await w.write(endChunk);
190
+ }
191
+
192
+ /** Write trailer headers to writer. It should mostly should be called after
193
+ * `writeResponse()`. */
194
+ export async function writeTrailers(
195
+ w: Deno.Writer,
196
+ headers: Headers,
197
+ trailers: Headers,
198
+ ): Promise<void> {
199
+ const trailer = headers.get("trailer");
200
+ if (trailer === null) {
201
+ throw new TypeError("Missing trailer header.");
202
+ }
203
+ const transferEncoding = headers.get("transfer-encoding");
204
+ if (transferEncoding === null || !transferEncoding.match(/^chunked/)) {
205
+ throw new TypeError(
206
+ `Trailers are only allowed for "transfer-encoding: chunked", got "transfer-encoding: ${transferEncoding}".`,
207
+ );
208
+ }
209
+ const writer = BufWriter.create(w);
210
+ const trailerNames = trailer.split(",").map((s) => s.trim().toLowerCase());
211
+ const prohibitedTrailers = trailerNames.filter((k) =>
212
+ isProhibidedForTrailer(k)
213
+ );
214
+ if (prohibitedTrailers.length > 0) {
215
+ throw new TypeError(
216
+ `Prohibited trailer names: ${Deno.inspect(prohibitedTrailers)}.`,
217
+ );
218
+ }
219
+ const undeclared = [...trailers.keys()].filter(
220
+ (k) => !trailerNames.includes(k),
221
+ );
222
+ if (undeclared.length > 0) {
223
+ throw new TypeError(`Undeclared trailers: ${Deno.inspect(undeclared)}.`);
224
+ }
225
+ for (const [key, value] of trailers) {
226
+ await writer.write(encoder.encode(`${key}: ${value}\r\n`));
227
+ }
228
+ await writer.write(encoder.encode("\r\n"));
229
+ await writer.flush();
230
+ }
231
+
232
+ export async function writeResponse(
233
+ w: Deno.Writer,
234
+ r: Response,
235
+ ): Promise<void> {
236
+ const protoMajor = 1;
237
+ const protoMinor = 1;
238
+ const statusCode = r.status || 200;
239
+ const statusText = STATUS_TEXT.get(statusCode);
240
+ const writer = BufWriter.create(w);
241
+ if (!statusText) {
242
+ throw new Deno.errors.InvalidData("Bad status code");
243
+ }
244
+ if (!r.body) {
245
+ r.body = new Uint8Array();
246
+ }
247
+ if (typeof r.body === "string") {
248
+ r.body = encoder.encode(r.body);
249
+ }
250
+
251
+ let out = `HTTP/${protoMajor}.${protoMinor} ${statusCode} ${statusText}\r\n`;
252
+
253
+ const headers = r.headers ?? new Headers();
254
+
255
+ if (r.body && !headers.get("content-length")) {
256
+ if (r.body instanceof Uint8Array) {
257
+ out += `content-length: ${r.body.byteLength}\r\n`;
258
+ } else if (!headers.get("transfer-encoding")) {
259
+ out += "transfer-encoding: chunked\r\n";
260
+ }
261
+ }
262
+
263
+ for (const [key, value] of headers) {
264
+ out += `${key}: ${value}\r\n`;
265
+ }
266
+
267
+ out += `\r\n`;
268
+
269
+ const header = encoder.encode(out);
270
+ const n = await writer.write(header);
271
+ assert(n === header.byteLength);
272
+
273
+ if (r.body instanceof Uint8Array) {
274
+ const n = await writer.write(r.body);
275
+ assert(n === r.body.byteLength);
276
+ } else if (headers.has("content-length")) {
277
+ const contentLength = headers.get("content-length");
278
+ assert(contentLength != null);
279
+ const bodyLength = parseInt(contentLength);
280
+ const n = await Deno.copy(r.body, writer);
281
+ assert(n === bodyLength);
282
+ } else {
283
+ await writeChunkedBody(writer, r.body);
284
+ }
285
+ if (r.trailers) {
286
+ const t = await r.trailers();
287
+ await writeTrailers(writer, headers, t);
288
+ }
289
+ await writer.flush();
290
+ }
291
+
292
+ /**
293
+ * ParseHTTPVersion parses a HTTP version string.
294
+ * "HTTP/1.0" returns (1, 0).
295
+ * Ported from https://github.com/golang/go/blob/f5c43b9/src/net/http/request.go#L766-L792
296
+ */
297
+ export function parseHTTPVersion(vers: string): [number, number] {
298
+ switch (vers) {
299
+ case "HTTP/1.1":
300
+ return [1, 1];
301
+
302
+ case "HTTP/1.0":
303
+ return [1, 0];
304
+
305
+ default: {
306
+ const Big = 1000000; // arbitrary upper bound
307
+
308
+ if (!vers.startsWith("HTTP/")) {
309
+ break;
310
+ }
311
+
312
+ const dot = vers.indexOf(".");
313
+ if (dot < 0) {
314
+ break;
315
+ }
316
+
317
+ const majorStr = vers.substring(vers.indexOf("/") + 1, dot);
318
+ const major = Number(majorStr);
319
+ if (!Number.isInteger(major) || major < 0 || major > Big) {
320
+ break;
321
+ }
322
+
323
+ const minorStr = vers.substring(dot + 1);
324
+ const minor = Number(minorStr);
325
+ if (!Number.isInteger(minor) || minor < 0 || minor > Big) {
326
+ break;
327
+ }
328
+
329
+ return [major, minor];
330
+ }
331
+ }
332
+
333
+ throw new Error(`malformed HTTP version ${vers}`);
334
+ }
335
+
336
+ export async function readRequest(
337
+ conn: Deno.Conn,
338
+ bufr: BufReader,
339
+ ): Promise<ServerRequest | null> {
340
+ const tp = new TextProtoReader(bufr);
341
+ const firstLine = await tp.readLine(); // e.g. GET /index.html HTTP/1.0
342
+ if (firstLine === null) return null;
343
+ const headers = await tp.readMIMEHeader();
344
+ if (headers === null) throw new Deno.errors.UnexpectedEof();
345
+
346
+ const req = new ServerRequest();
347
+ req.conn = conn;
348
+ req.r = bufr;
349
+ [req.method, req.url, req.proto] = firstLine.split(" ", 3);
350
+ [req.protoMajor, req.protoMinor] = parseHTTPVersion(req.proto);
351
+ req.headers = headers;
352
+ fixLength(req);
353
+ return req;
354
+ }
355
+
356
+ function fixLength(req: ServerRequest): void {
357
+ const contentLength = req.headers.get("Content-Length");
358
+ if (contentLength) {
359
+ const arrClen = contentLength.split(",");
360
+ if (arrClen.length > 1) {
361
+ const distinct = [...new Set(arrClen.map((e): string => e.trim()))];
362
+ if (distinct.length > 1) {
363
+ throw Error("cannot contain multiple Content-Length headers");
364
+ } else {
365
+ req.headers.set("Content-Length", distinct[0]);
366
+ }
367
+ }
368
+ const c = req.headers.get("Content-Length");
369
+ if (req.method === "HEAD" && c && c !== "0") {
370
+ throw Error("http: method cannot contain a Content-Length");
371
+ }
372
+ if (c && req.headers.has("transfer-encoding")) {
373
+ // A sender MUST NOT send a Content-Length header field in any message
374
+ // that contains a Transfer-Encoding header field.
375
+ // rfc: https://tools.ietf.org/html/rfc7230#section-3.3.2
376
+ throw new Error(
377
+ "http: Transfer-Encoding and Content-Length cannot be send together",
378
+ );
379
+ }
380
+ }
381
+ }
.deno/deps/https/deno.land/68c0328e6ee41a9088cacf7c7ec358c0b7e757cf39291f2273f4b8d7950e2185.metadata.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "headers": {
3
+ "x-amz-cf-pop": "SEA73-P3",
4
+ "server": "deno/gcp-us-west1",
5
+ "server-timing": "fetchSource;dur=12",
6
+ "date": "Mon, 04 Sep 2023 17:52:41 GMT",
7
+ "x-content-type-options": "nosniff",
8
+ "cross-origin-resource-policy": "same-origin",
9
+ "etag": "\"ad756cb543f4575718c3a72164134f37\"",
10
+ "content-type": "application/typescript; charset=utf-8",
11
+ "vary": "Accept-Encoding, Origin",
12
+ "x-amz-version-id": "E4k6O3yOBIgsv9OsiMlAdsIeqOLIMlah",
13
+ "access-control-allow-origin": "*",
14
+ "age": "947175",
15
+ "x-amz-replication-status": "COMPLETED",
16
+ "referrer-policy": "strict-origin-when-cross-origin",
17
+ "cross-origin-embedder-policy": "same-origin",
18
+ "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
19
+ "via": "http/2 edgeproxy-h",
20
+ "content-length": "11578",
21
+ "x-frame-options": "DENY",
22
+ "accept-ranges": "bytes",
23
+ "cross-origin-opener-policy": "same-origin",
24
+ "strict-transport-security": "max-age=63072000; includeSubDomains; preload",
25
+ "x-amz-cf-id": "2OJemX1uBy4x1KJcOAgj7Rby4anC6FOb6H4QgOnS_vyNjE9VQnGMww==",
26
+ "x-cache": "Hit from cloudfront",
27
+ "last-modified": "Fri, 02 Apr 2021 05:03:19 GMT",
28
+ "cache-control": "public, max-age=31536000, immutable"
29
+ },
30
+ "url": "https://deno.land/std@0.92.0/http/_io.ts",
31
+ "now": {
32
+ "secs_since_epoch": 1694797135,
33
+ "nanos_since_epoch": 969905149
34
+ }
35
+ }
.deno/deps/https/deno.land/6b53dbda29cf8186bf78dc67d9f2b44c60d22f4d20d66dccce32493e9c631b18 ADDED
@@ -0,0 +1,720 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
2
+ // Based on https://github.com/golang/go/blob/891682/src/bufio/bufio.go
3
+ // Copyright 2009 The Go Authors. All rights reserved.
4
+ // Use of this source code is governed by a BSD-style
5
+ // license that can be found in the LICENSE file.
6
+
7
+ type Reader = Deno.Reader;
8
+ type Writer = Deno.Writer;
9
+ type WriterSync = Deno.WriterSync;
10
+ import { copy } from "../bytes/mod.ts";
11
+ import { assert } from "../_util/assert.ts";
12
+ import { Buffer } from "./buffer.ts";
13
+ import { writeAll, writeAllSync } from "./util.ts";
14
+
15
+ const DEFAULT_BUF_SIZE = 4096;
16
+ const MIN_BUF_SIZE = 16;
17
+ const MAX_CONSECUTIVE_EMPTY_READS = 100;
18
+ const CR = "\r".charCodeAt(0);
19
+ const LF = "\n".charCodeAt(0);
20
+
21
+ export class BufferFullError extends Error {
22
+ name = "BufferFullError";
23
+ constructor(public partial: Uint8Array) {
24
+ super("Buffer full");
25
+ }
26
+ }
27
+
28
+ export class PartialReadError extends Error {
29
+ name = "PartialReadError";
30
+ partial?: Uint8Array;
31
+ constructor() {
32
+ super("Encountered UnexpectedEof, data only partially read");
33
+ }
34
+ }
35
+
36
+ /** Result type returned by of BufReader.readLine(). */
37
+ export interface ReadLineResult {
38
+ line: Uint8Array;
39
+ more: boolean;
40
+ }
41
+
42
+ /** BufReader implements buffering for a Reader object. */
43
+ export class BufReader implements Reader {
44
+ private buf!: Uint8Array;
45
+ private rd!: Reader; // Reader provided by caller.
46
+ private r = 0; // buf read position.
47
+ private w = 0; // buf write position.
48
+ private eof = false;
49
+ // private lastByte: number;
50
+ // private lastCharSize: number;
51
+
52
+ /** return new BufReader unless r is BufReader */
53
+ static create(r: Reader, size: number = DEFAULT_BUF_SIZE): BufReader {
54
+ return r instanceof BufReader ? r : new BufReader(r, size);
55
+ }
56
+
57
+ constructor(rd: Reader, size: number = DEFAULT_BUF_SIZE) {
58
+ if (size < MIN_BUF_SIZE) {
59
+ size = MIN_BUF_SIZE;
60
+ }
61
+ this._reset(new Uint8Array(size), rd);
62
+ }
63
+
64
+ /** Returns the size of the underlying buffer in bytes. */
65
+ size(): number {
66
+ return this.buf.byteLength;
67
+ }
68
+
69
+ buffered(): number {
70
+ return this.w - this.r;
71
+ }
72
+
73
+ // Reads a new chunk into the buffer.
74
+ private async _fill(): Promise<void> {
75
+ // Slide existing data to beginning.
76
+ if (this.r > 0) {
77
+ this.buf.copyWithin(0, this.r, this.w);
78
+ this.w -= this.r;
79
+ this.r = 0;
80
+ }
81
+
82
+ if (this.w >= this.buf.byteLength) {
83
+ throw Error("bufio: tried to fill full buffer");
84
+ }
85
+
86
+ // Read new data: try a limited number of times.
87
+ for (let i = MAX_CONSECUTIVE_EMPTY_READS; i > 0; i--) {
88
+ const rr = await this.rd.read(this.buf.subarray(this.w));
89
+ if (rr === null) {
90
+ this.eof = true;
91
+ return;
92
+ }
93
+ assert(rr >= 0, "negative read");
94
+ this.w += rr;
95
+ if (rr > 0) {
96
+ return;
97
+ }
98
+ }
99
+
100
+ throw new Error(
101
+ `No progress after ${MAX_CONSECUTIVE_EMPTY_READS} read() calls`,
102
+ );
103
+ }
104
+
105
+ /** Discards any buffered data, resets all state, and switches
106
+ * the buffered reader to read from r.
107
+ */
108
+ reset(r: Reader): void {
109
+ this._reset(this.buf, r);
110
+ }
111
+
112
+ private _reset(buf: Uint8Array, rd: Reader): void {
113
+ this.buf = buf;
114
+ this.rd = rd;
115
+ this.eof = false;
116
+ // this.lastByte = -1;
117
+ // this.lastCharSize = -1;
118
+ }
119
+
120
+ /** reads data into p.
121
+ * It returns the number of bytes read into p.
122
+ * The bytes are taken from at most one Read on the underlying Reader,
123
+ * hence n may be less than len(p).
124
+ * To read exactly len(p) bytes, use io.ReadFull(b, p).
125
+ */
126
+ async read(p: Uint8Array): Promise<number | null> {
127
+ let rr: number | null = p.byteLength;
128
+ if (p.byteLength === 0) return rr;
129
+
130
+ if (this.r === this.w) {
131
+ if (p.byteLength >= this.buf.byteLength) {
132
+ // Large read, empty buffer.
133
+ // Read directly into p to avoid copy.
134
+ const rr = await this.rd.read(p);
135
+ const nread = rr ?? 0;
136
+ assert(nread >= 0, "negative read");
137
+ // if (rr.nread > 0) {
138
+ // this.lastByte = p[rr.nread - 1];
139
+ // this.lastCharSize = -1;
140
+ // }
141
+ return rr;
142
+ }
143
+
144
+ // One read.
145
+ // Do not use this.fill, which will loop.
146
+ this.r = 0;
147
+ this.w = 0;
148
+ rr = await this.rd.read(this.buf);
149
+ if (rr === 0 || rr === null) return rr;
150
+ assert(rr >= 0, "negative read");
151
+ this.w += rr;
152
+ }
153
+
154
+ // copy as much as we can
155
+ const copied = copy(this.buf.subarray(this.r, this.w), p, 0);
156
+ this.r += copied;
157
+ // this.lastByte = this.buf[this.r - 1];
158
+ // this.lastCharSize = -1;
159
+ return copied;
160
+ }
161
+
162
+ /** reads exactly `p.length` bytes into `p`.
163
+ *
164
+ * If successful, `p` is returned.
165
+ *
166
+ * If the end of the underlying stream has been reached, and there are no more
167
+ * bytes available in the buffer, `readFull()` returns `null` instead.
168
+ *
169
+ * An error is thrown if some bytes could be read, but not enough to fill `p`
170
+ * entirely before the underlying stream reported an error or EOF. Any error
171
+ * thrown will have a `partial` property that indicates the slice of the
172
+ * buffer that has been successfully filled with data.
173
+ *
174
+ * Ported from https://golang.org/pkg/io/#ReadFull
175
+ */
176
+ async readFull(p: Uint8Array): Promise<Uint8Array | null> {
177
+ let bytesRead = 0;
178
+ while (bytesRead < p.length) {
179
+ try {
180
+ const rr = await this.read(p.subarray(bytesRead));
181
+ if (rr === null) {
182
+ if (bytesRead === 0) {
183
+ return null;
184
+ } else {
185
+ throw new PartialReadError();
186
+ }
187
+ }
188
+ bytesRead += rr;
189
+ } catch (err) {
190
+ err.partial = p.subarray(0, bytesRead);
191
+ throw err;
192
+ }
193
+ }
194
+ return p;
195
+ }
196
+
197
+ /** Returns the next byte [0, 255] or `null`. */
198
+ async readByte(): Promise<number | null> {
199
+ while (this.r === this.w) {
200
+ if (this.eof) return null;
201
+ await this._fill(); // buffer is empty.
202
+ }
203
+ const c = this.buf[this.r];
204
+ this.r++;
205
+ // this.lastByte = c;
206
+ return c;
207
+ }
208
+
209
+ /** readString() reads until the first occurrence of delim in the input,
210
+ * returning a string containing the data up to and including the delimiter.
211
+ * If ReadString encounters an error before finding a delimiter,
212
+ * it returns the data read before the error and the error itself
213
+ * (often `null`).
214
+ * ReadString returns err != nil if and only if the returned data does not end
215
+ * in delim.
216
+ * For simple uses, a Scanner may be more convenient.
217
+ */
218
+ async readString(delim: string): Promise<string | null> {
219
+ if (delim.length !== 1) {
220
+ throw new Error("Delimiter should be a single character");
221
+ }
222
+ const buffer = await this.readSlice(delim.charCodeAt(0));
223
+ if (buffer === null) return null;
224
+ return new TextDecoder().decode(buffer);
225
+ }
226
+
227
+ /** `readLine()` is a low-level line-reading primitive. Most callers should
228
+ * use `readString('\n')` instead or use a Scanner.
229
+ *
230
+ * `readLine()` tries to return a single line, not including the end-of-line
231
+ * bytes. If the line was too long for the buffer then `more` is set and the
232
+ * beginning of the line is returned. The rest of the line will be returned
233
+ * from future calls. `more` will be false when returning the last fragment
234
+ * of the line. The returned buffer is only valid until the next call to
235
+ * `readLine()`.
236
+ *
237
+ * The text returned from ReadLine does not include the line end ("\r\n" or
238
+ * "\n").
239
+ *
240
+ * When the end of the underlying stream is reached, the final bytes in the
241
+ * stream are returned. No indication or error is given if the input ends
242
+ * without a final line end. When there are no more trailing bytes to read,
243
+ * `readLine()` returns `null`.
244
+ *
245
+ * Calling `unreadByte()` after `readLine()` will always unread the last byte
246
+ * read (possibly a character belonging to the line end) even if that byte is
247
+ * not part of the line returned by `readLine()`.
248
+ */
249
+ async readLine(): Promise<ReadLineResult | null> {
250
+ let line: Uint8Array | null;
251
+
252
+ try {
253
+ line = await this.readSlice(LF);
254
+ } catch (err) {
255
+ let { partial } = err;
256
+ assert(
257
+ partial instanceof Uint8Array,
258
+ "bufio: caught error from `readSlice()` without `partial` property",
259
+ );
260
+
261
+ // Don't throw if `readSlice()` failed with `BufferFullError`, instead we
262
+ // just return whatever is available and set the `more` flag.
263
+ if (!(err instanceof BufferFullError)) {
264
+ throw err;
265
+ }
266
+
267
+ // Handle the case where "\r\n" straddles the buffer.
268
+ if (
269
+ !this.eof &&
270
+ partial.byteLength > 0 &&
271
+ partial[partial.byteLength - 1] === CR
272
+ ) {
273
+ // Put the '\r' back on buf and drop it from line.
274
+ // Let the next call to ReadLine check for "\r\n".
275
+ assert(this.r > 0, "bufio: tried to rewind past start of buffer");
276
+ this.r--;
277
+ partial = partial.subarray(0, partial.byteLength - 1);
278
+ }
279
+
280
+ return { line: partial, more: !this.eof };
281
+ }
282
+
283
+ if (line === null) {
284
+ return null;
285
+ }
286
+
287
+ if (line.byteLength === 0) {
288
+ return { line, more: false };
289
+ }
290
+
291
+ if (line[line.byteLength - 1] == LF) {
292
+ let drop = 1;
293
+ if (line.byteLength > 1 && line[line.byteLength - 2] === CR) {
294
+ drop = 2;
295
+ }
296
+ line = line.subarray(0, line.byteLength - drop);
297
+ }
298
+ return { line, more: false };
299
+ }
300
+
301
+ /** `readSlice()` reads until the first occurrence of `delim` in the input,
302
+ * returning a slice pointing at the bytes in the buffer. The bytes stop
303
+ * being valid at the next read.
304
+ *
305
+ * If `readSlice()` encounters an error before finding a delimiter, or the
306
+ * buffer fills without finding a delimiter, it throws an error with a
307
+ * `partial` property that contains the entire buffer.
308
+ *
309
+ * If `readSlice()` encounters the end of the underlying stream and there are
310
+ * any bytes left in the buffer, the rest of the buffer is returned. In other
311
+ * words, EOF is always treated as a delimiter. Once the buffer is empty,
312
+ * it returns `null`.
313
+ *
314
+ * Because the data returned from `readSlice()` will be overwritten by the
315
+ * next I/O operation, most clients should use `readString()` instead.
316
+ */
317
+ async readSlice(delim: number): Promise<Uint8Array | null> {
318
+ let s = 0; // search start index
319
+ let slice: Uint8Array | undefined;
320
+
321
+ while (true) {
322
+ // Search buffer.
323
+ let i = this.buf.subarray(this.r + s, this.w).indexOf(delim);
324
+ if (i >= 0) {
325
+ i += s;
326
+ slice = this.buf.subarray(this.r, this.r + i + 1);
327
+ this.r += i + 1;
328
+ break;
329
+ }
330
+
331
+ // EOF?
332
+ if (this.eof) {
333
+ if (this.r === this.w) {
334
+ return null;
335
+ }
336
+ slice = this.buf.subarray(this.r, this.w);
337
+ this.r = this.w;
338
+ break;
339
+ }
340
+
341
+ // Buffer full?
342
+ if (this.buffered() >= this.buf.byteLength) {
343
+ this.r = this.w;
344
+ // #4521 The internal buffer should not be reused across reads because it causes corruption of data.
345
+ const oldbuf = this.buf;
346
+ const newbuf = this.buf.slice(0);
347
+ this.buf = newbuf;
348
+ throw new BufferFullError(oldbuf);
349
+ }
350
+
351
+ s = this.w - this.r; // do not rescan area we scanned before
352
+
353
+ // Buffer is not full.
354
+ try {
355
+ await this._fill();
356
+ } catch (err) {
357
+ err.partial = slice;
358
+ throw err;
359
+ }
360
+ }
361
+
362
+ // Handle last byte, if any.
363
+ // const i = slice.byteLength - 1;
364
+ // if (i >= 0) {
365
+ // this.lastByte = slice[i];
366
+ // this.lastCharSize = -1
367
+ // }
368
+
369
+ return slice;
370
+ }
371
+
372
+ /** `peek()` returns the next `n` bytes without advancing the reader. The
373
+ * bytes stop being valid at the next read call.
374
+ *
375
+ * When the end of the underlying stream is reached, but there are unread
376
+ * bytes left in the buffer, those bytes are returned. If there are no bytes
377
+ * left in the buffer, it returns `null`.
378
+ *
379
+ * If an error is encountered before `n` bytes are available, `peek()` throws
380
+ * an error with the `partial` property set to a slice of the buffer that
381
+ * contains the bytes that were available before the error occurred.
382
+ */
383
+ async peek(n: number): Promise<Uint8Array | null> {
384
+ if (n < 0) {
385
+ throw Error("negative count");
386
+ }
387
+
388
+ let avail = this.w - this.r;
389
+ while (avail < n && avail < this.buf.byteLength && !this.eof) {
390
+ try {
391
+ await this._fill();
392
+ } catch (err) {
393
+ err.partial = this.buf.subarray(this.r, this.w);
394
+ throw err;
395
+ }
396
+ avail = this.w - this.r;
397
+ }
398
+
399
+ if (avail === 0 && this.eof) {
400
+ return null;
401
+ } else if (avail < n && this.eof) {
402
+ return this.buf.subarray(this.r, this.r + avail);
403
+ } else if (avail < n) {
404
+ throw new BufferFullError(this.buf.subarray(this.r, this.w));
405
+ }
406
+
407
+ return this.buf.subarray(this.r, this.r + n);
408
+ }
409
+ }
410
+
411
+ abstract class AbstractBufBase {
412
+ buf!: Uint8Array;
413
+ usedBufferBytes = 0;
414
+ err: Error | null = null;
415
+
416
+ /** Size returns the size of the underlying buffer in bytes. */
417
+ size(): number {
418
+ return this.buf.byteLength;
419
+ }
420
+
421
+ /** Returns how many bytes are unused in the buffer. */
422
+ available(): number {
423
+ return this.buf.byteLength - this.usedBufferBytes;
424
+ }
425
+
426
+ /** buffered returns the number of bytes that have been written into the
427
+ * current buffer.
428
+ */
429
+ buffered(): number {
430
+ return this.usedBufferBytes;
431
+ }
432
+ }
433
+
434
+ /** BufWriter implements buffering for an deno.Writer object.
435
+ * If an error occurs writing to a Writer, no more data will be
436
+ * accepted and all subsequent writes, and flush(), will return the error.
437
+ * After all data has been written, the client should call the
438
+ * flush() method to guarantee all data has been forwarded to
439
+ * the underlying deno.Writer.
440
+ */
441
+ export class BufWriter extends AbstractBufBase implements Writer {
442
+ /** return new BufWriter unless writer is BufWriter */
443
+ static create(writer: Writer, size: number = DEFAULT_BUF_SIZE): BufWriter {
444
+ return writer instanceof BufWriter ? writer : new BufWriter(writer, size);
445
+ }
446
+
447
+ constructor(private writer: Writer, size: number = DEFAULT_BUF_SIZE) {
448
+ super();
449
+ if (size <= 0) {
450
+ size = DEFAULT_BUF_SIZE;
451
+ }
452
+ this.buf = new Uint8Array(size);
453
+ }
454
+
455
+ /** Discards any unflushed buffered data, clears any error, and
456
+ * resets buffer to write its output to w.
457
+ */
458
+ reset(w: Writer): void {
459
+ this.err = null;
460
+ this.usedBufferBytes = 0;
461
+ this.writer = w;
462
+ }
463
+
464
+ /** Flush writes any buffered data to the underlying io.Writer. */
465
+ async flush(): Promise<void> {
466
+ if (this.err !== null) throw this.err;
467
+ if (this.usedBufferBytes === 0) return;
468
+
469
+ try {
470
+ await writeAll(
471
+ this.writer,
472
+ this.buf.subarray(0, this.usedBufferBytes),
473
+ );
474
+ } catch (e) {
475
+ this.err = e;
476
+ throw e;
477
+ }
478
+
479
+ this.buf = new Uint8Array(this.buf.length);
480
+ this.usedBufferBytes = 0;
481
+ }
482
+
483
+ /** Writes the contents of `data` into the buffer. If the contents won't fully
484
+ * fit into the buffer, those bytes that can are copied into the buffer, the
485
+ * buffer is the flushed to the writer and the remaining bytes are copied into
486
+ * the now empty buffer.
487
+ *
488
+ * @return the number of bytes written to the buffer.
489
+ */
490
+ async write(data: Uint8Array): Promise<number> {
491
+ if (this.err !== null) throw this.err;
492
+ if (data.length === 0) return 0;
493
+
494
+ let totalBytesWritten = 0;
495
+ let numBytesWritten = 0;
496
+ while (data.byteLength > this.available()) {
497
+ if (this.buffered() === 0) {
498
+ // Large write, empty buffer.
499
+ // Write directly from data to avoid copy.
500
+ try {
501
+ numBytesWritten = await this.writer.write(data);
502
+ } catch (e) {
503
+ this.err = e;
504
+ throw e;
505
+ }
506
+ } else {
507
+ numBytesWritten = copy(data, this.buf, this.usedBufferBytes);
508
+ this.usedBufferBytes += numBytesWritten;
509
+ await this.flush();
510
+ }
511
+ totalBytesWritten += numBytesWritten;
512
+ data = data.subarray(numBytesWritten);
513
+ }
514
+
515
+ numBytesWritten = copy(data, this.buf, this.usedBufferBytes);
516
+ this.usedBufferBytes += numBytesWritten;
517
+ totalBytesWritten += numBytesWritten;
518
+ return totalBytesWritten;
519
+ }
520
+ }
521
+
522
+ /** BufWriterSync implements buffering for a deno.WriterSync object.
523
+ * If an error occurs writing to a WriterSync, no more data will be
524
+ * accepted and all subsequent writes, and flush(), will return the error.
525
+ * After all data has been written, the client should call the
526
+ * flush() method to guarantee all data has been forwarded to
527
+ * the underlying deno.WriterSync.
528
+ */
529
+ export class BufWriterSync extends AbstractBufBase implements WriterSync {
530
+ /** return new BufWriterSync unless writer is BufWriterSync */
531
+ static create(
532
+ writer: WriterSync,
533
+ size: number = DEFAULT_BUF_SIZE,
534
+ ): BufWriterSync {
535
+ return writer instanceof BufWriterSync
536
+ ? writer
537
+ : new BufWriterSync(writer, size);
538
+ }
539
+
540
+ constructor(private writer: WriterSync, size: number = DEFAULT_BUF_SIZE) {
541
+ super();
542
+ if (size <= 0) {
543
+ size = DEFAULT_BUF_SIZE;
544
+ }
545
+ this.buf = new Uint8Array(size);
546
+ }
547
+
548
+ /** Discards any unflushed buffered data, clears any error, and
549
+ * resets buffer to write its output to w.
550
+ */
551
+ reset(w: WriterSync): void {
552
+ this.err = null;
553
+ this.usedBufferBytes = 0;
554
+ this.writer = w;
555
+ }
556
+
557
+ /** Flush writes any buffered data to the underlying io.WriterSync. */
558
+ flush(): void {
559
+ if (this.err !== null) throw this.err;
560
+ if (this.usedBufferBytes === 0) return;
561
+
562
+ try {
563
+ writeAllSync(
564
+ this.writer,
565
+ this.buf.subarray(0, this.usedBufferBytes),
566
+ );
567
+ } catch (e) {
568
+ this.err = e;
569
+ throw e;
570
+ }
571
+
572
+ this.buf = new Uint8Array(this.buf.length);
573
+ this.usedBufferBytes = 0;
574
+ }
575
+
576
+ /** Writes the contents of `data` into the buffer. If the contents won't fully
577
+ * fit into the buffer, those bytes that can are copied into the buffer, the
578
+ * buffer is the flushed to the writer and the remaining bytes are copied into
579
+ * the now empty buffer.
580
+ *
581
+ * @return the number of bytes written to the buffer.
582
+ */
583
+ writeSync(data: Uint8Array): number {
584
+ if (this.err !== null) throw this.err;
585
+ if (data.length === 0) return 0;
586
+
587
+ let totalBytesWritten = 0;
588
+ let numBytesWritten = 0;
589
+ while (data.byteLength > this.available()) {
590
+ if (this.buffered() === 0) {
591
+ // Large write, empty buffer.
592
+ // Write directly from data to avoid copy.
593
+ try {
594
+ numBytesWritten = this.writer.writeSync(data);
595
+ } catch (e) {
596
+ this.err = e;
597
+ throw e;
598
+ }
599
+ } else {
600
+ numBytesWritten = copy(data, this.buf, this.usedBufferBytes);
601
+ this.usedBufferBytes += numBytesWritten;
602
+ this.flush();
603
+ }
604
+ totalBytesWritten += numBytesWritten;
605
+ data = data.subarray(numBytesWritten);
606
+ }
607
+
608
+ numBytesWritten = copy(data, this.buf, this.usedBufferBytes);
609
+ this.usedBufferBytes += numBytesWritten;
610
+ totalBytesWritten += numBytesWritten;
611
+ return totalBytesWritten;
612
+ }
613
+ }
614
+
615
+ /** Generate longest proper prefix which is also suffix array. */
616
+ function createLPS(pat: Uint8Array): Uint8Array {
617
+ const lps = new Uint8Array(pat.length);
618
+ lps[0] = 0;
619
+ let prefixEnd = 0;
620
+ let i = 1;
621
+ while (i < lps.length) {
622
+ if (pat[i] == pat[prefixEnd]) {
623
+ prefixEnd++;
624
+ lps[i] = prefixEnd;
625
+ i++;
626
+ } else if (prefixEnd === 0) {
627
+ lps[i] = 0;
628
+ i++;
629
+ } else {
630
+ prefixEnd = pat[prefixEnd - 1];
631
+ }
632
+ }
633
+ return lps;
634
+ }
635
+
636
+ /** Read delimited bytes from a Reader. */
637
+ export async function* readDelim(
638
+ reader: Reader,
639
+ delim: Uint8Array,
640
+ ): AsyncIterableIterator<Uint8Array> {
641
+ // Avoid unicode problems
642
+ const delimLen = delim.length;
643
+ const delimLPS = createLPS(delim);
644
+
645
+ let inputBuffer = new Buffer();
646
+ const inspectArr = new Uint8Array(Math.max(1024, delimLen + 1));
647
+
648
+ // Modified KMP
649
+ let inspectIndex = 0;
650
+ let matchIndex = 0;
651
+ while (true) {
652
+ const result = await reader.read(inspectArr);
653
+ if (result === null) {
654
+ // Yield last chunk.
655
+ yield inputBuffer.bytes();
656
+ return;
657
+ }
658
+ if ((result as number) < 0) {
659
+ // Discard all remaining and silently fail.
660
+ return;
661
+ }
662
+ const sliceRead = inspectArr.subarray(0, result as number);
663
+ await writeAll(inputBuffer, sliceRead);
664
+
665
+ let sliceToProcess = inputBuffer.bytes();
666
+ while (inspectIndex < sliceToProcess.length) {
667
+ if (sliceToProcess[inspectIndex] === delim[matchIndex]) {
668
+ inspectIndex++;
669
+ matchIndex++;
670
+ if (matchIndex === delimLen) {
671
+ // Full match
672
+ const matchEnd = inspectIndex - delimLen;
673
+ const readyBytes = sliceToProcess.subarray(0, matchEnd);
674
+ // Copy
675
+ const pendingBytes = sliceToProcess.slice(inspectIndex);
676
+ yield readyBytes;
677
+ // Reset match, different from KMP.
678
+ sliceToProcess = pendingBytes;
679
+ inspectIndex = 0;
680
+ matchIndex = 0;
681
+ }
682
+ } else {
683
+ if (matchIndex === 0) {
684
+ inspectIndex++;
685
+ } else {
686
+ matchIndex = delimLPS[matchIndex - 1];
687
+ }
688
+ }
689
+ }
690
+ // Keep inspectIndex and matchIndex.
691
+ inputBuffer = new Buffer(sliceToProcess);
692
+ }
693
+ }
694
+
695
+ /** Read delimited strings from a Reader. */
696
+ export async function* readStringDelim(
697
+ reader: Reader,
698
+ delim: string,
699
+ ): AsyncIterableIterator<string> {
700
+ const encoder = new TextEncoder();
701
+ const decoder = new TextDecoder();
702
+ for await (const chunk of readDelim(reader, encoder.encode(delim))) {
703
+ yield decoder.decode(chunk);
704
+ }
705
+ }
706
+
707
+ /** Read strings line-by-line from a Reader. */
708
+ export async function* readLines(
709
+ reader: Reader,
710
+ ): AsyncIterableIterator<string> {
711
+ for await (let chunk of readStringDelim(reader, "\n")) {
712
+ // Finding a CR at the end of the line is evidence of a
713
+ // "\r\n" at the end of the line. The "\r" part should be
714
+ // removed too.
715
+ if (chunk.endsWith("\r")) {
716
+ chunk = chunk.slice(0, -1);
717
+ }
718
+ yield chunk;
719
+ }
720
+ }
.deno/deps/https/deno.land/6b53dbda29cf8186bf78dc67d9f2b44c60d22f4d20d66dccce32493e9c631b18.metadata.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "headers": {
3
+ "access-control-allow-origin": "*",
4
+ "x-content-type-options": "nosniff",
5
+ "last-modified": "Fri, 02 Apr 2021 05:03:19 GMT",
6
+ "x-frame-options": "DENY",
7
+ "content-length": "21962",
8
+ "cross-origin-embedder-policy": "same-origin",
9
+ "server": "deno/gcp-us-west1",
10
+ "x-amz-replication-status": "FAILED",
11
+ "vary": "Accept-Encoding, Origin",
12
+ "age": "28911889",
13
+ "referrer-policy": "strict-origin-when-cross-origin",
14
+ "accept-ranges": "bytes",
15
+ "x-amz-cf-pop": "SEA73-P3",
16
+ "etag": "\"cbb89e0002be7a07066555cf1e7d3835\"",
17
+ "cross-origin-resource-policy": "same-origin",
18
+ "x-amz-version-id": "69Hwreb4GYd0JSntgnF2xVKzXXytMWDB",
19
+ "date": "Sun, 16 Oct 2022 01:54:07 GMT",
20
+ "via": "http/2 edgeproxy-h",
21
+ "server-timing": "fetchSource;dur=14",
22
+ "content-type": "application/typescript; charset=utf-8",
23
+ "cross-origin-opener-policy": "same-origin",
24
+ "strict-transport-security": "max-age=63072000; includeSubDomains; preload",
25
+ "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
26
+ "x-amz-cf-id": "SpPPJR0A34_2JnUA0plzBf2zmtC_JHU-2AWxng7tn5maGzjN6GjNmg==",
27
+ "x-cache": "Hit from cloudfront",
28
+ "cache-control": "public, max-age=31536000, immutable"
29
+ },
30
+ "url": "https://deno.land/std@0.92.0/io/bufio.ts",
31
+ "now": {
32
+ "secs_since_epoch": 1694797135,
33
+ "nanos_since_epoch": 961248980
34
+ }
35
+ }
.deno/deps/https/deno.land/79fa3fa51a04a2aa15ce1e2f8f6d15c1b792c62ecec496f3f23b9f0042f45156 ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
2
+
3
+ export class DenoStdInternalError extends Error {
4
+ constructor(message: string) {
5
+ super(message);
6
+ this.name = "DenoStdInternalError";
7
+ }
8
+ }
9
+
10
+ /** Make an assertion, if not `true`, then throw. */
11
+ export function assert(expr: unknown, msg = ""): asserts expr {
12
+ if (!expr) {
13
+ throw new DenoStdInternalError(msg);
14
+ }
15
+ }
.deno/deps/https/deno.land/79fa3fa51a04a2aa15ce1e2f8f6d15c1b792c62ecec496f3f23b9f0042f45156.metadata.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "headers": {
3
+ "cross-origin-embedder-policy": "same-origin",
4
+ "x-amz-cf-id": "jPPtAlrdyYFygkOfBSS0hC-v4kBlvCmOHoap2wuVpOcGZ8fbsU4jHQ==",
5
+ "x-cache": "Hit from cloudfront",
6
+ "content-length": "405",
7
+ "last-modified": "Wed, 20 Jan 2021 05:26:03 GMT",
8
+ "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
9
+ "age": "198167",
10
+ "server-timing": "fetchSource;dur=16",
11
+ "accept-ranges": "bytes",
12
+ "server": "deno/gcp-us-west1",
13
+ "referrer-policy": "strict-origin-when-cross-origin",
14
+ "x-amz-version-id": "aiYqddAODlxlnFkzLSc7wD_zf0JlIO1I",
15
+ "cache-control": "public, max-age=31536000, immutable",
16
+ "date": "Wed, 13 Sep 2023 09:56:10 GMT",
17
+ "x-frame-options": "DENY",
18
+ "via": "http/2 edgeproxy-h",
19
+ "x-amz-replication-status": "COMPLETED",
20
+ "x-amz-cf-pop": "SEA73-P3",
21
+ "cross-origin-opener-policy": "same-origin",
22
+ "content-type": "application/typescript; charset=utf-8",
23
+ "access-control-allow-origin": "*",
24
+ "etag": "\"e5ce4111fb107a7ba5b5f7667b7bda6a\"",
25
+ "strict-transport-security": "max-age=63072000; includeSubDomains; preload",
26
+ "vary": "Accept-Encoding, Origin",
27
+ "cross-origin-resource-policy": "same-origin",
28
+ "x-content-type-options": "nosniff"
29
+ },
30
+ "url": "https://deno.land/std@0.84.0/_util/assert.ts",
31
+ "now": {
32
+ "secs_since_epoch": 1694797136,
33
+ "nanos_since_epoch": 844987909
34
+ }
35
+ }
.deno/deps/https/deno.land/7c84f0bf5dd8c48257088f96cefebf3520889c2938e74ef31eb5ca0ed3398b6e ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright the Browserify authors. MIT License.
2
+ // Ported from https://github.com/browserify/path-browserify/
3
+ // This module is browser compatible.
4
+
5
+ import type { FormatInputPathObject } from "./_interface.ts";
6
+ import {
7
+ CHAR_BACKWARD_SLASH,
8
+ CHAR_DOT,
9
+ CHAR_FORWARD_SLASH,
10
+ CHAR_LOWERCASE_A,
11
+ CHAR_LOWERCASE_Z,
12
+ CHAR_UPPERCASE_A,
13
+ CHAR_UPPERCASE_Z,
14
+ } from "./_constants.ts";
15
+
16
+ export function assertPath(path: string): void {
17
+ if (typeof path !== "string") {
18
+ throw new TypeError(
19
+ `Path must be a string. Received ${JSON.stringify(path)}`,
20
+ );
21
+ }
22
+ }
23
+
24
+ export function isPosixPathSeparator(code: number): boolean {
25
+ return code === CHAR_FORWARD_SLASH;
26
+ }
27
+
28
+ export function isPathSeparator(code: number): boolean {
29
+ return isPosixPathSeparator(code) || code === CHAR_BACKWARD_SLASH;
30
+ }
31
+
32
+ export function isWindowsDeviceRoot(code: number): boolean {
33
+ return (
34
+ (code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z) ||
35
+ (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z)
36
+ );
37
+ }
38
+
39
+ // Resolves . and .. elements in a path with directory names
40
+ export function normalizeString(
41
+ path: string,
42
+ allowAboveRoot: boolean,
43
+ separator: string,
44
+ isPathSeparator: (code: number) => boolean,
45
+ ): string {
46
+ let res = "";
47
+ let lastSegmentLength = 0;
48
+ let lastSlash = -1;
49
+ let dots = 0;
50
+ let code: number | undefined;
51
+ for (let i = 0, len = path.length; i <= len; ++i) {
52
+ if (i < len) code = path.charCodeAt(i);
53
+ else if (isPathSeparator(code!)) break;
54
+ else code = CHAR_FORWARD_SLASH;
55
+
56
+ if (isPathSeparator(code!)) {
57
+ if (lastSlash === i - 1 || dots === 1) {
58
+ // NOOP
59
+ } else if (lastSlash !== i - 1 && dots === 2) {
60
+ if (
61
+ res.length < 2 ||
62
+ lastSegmentLength !== 2 ||
63
+ res.charCodeAt(res.length - 1) !== CHAR_DOT ||
64
+ res.charCodeAt(res.length - 2) !== CHAR_DOT
65
+ ) {
66
+ if (res.length > 2) {
67
+ const lastSlashIndex = res.lastIndexOf(separator);
68
+ if (lastSlashIndex === -1) {
69
+ res = "";
70
+ lastSegmentLength = 0;
71
+ } else {
72
+ res = res.slice(0, lastSlashIndex);
73
+ lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);
74
+ }
75
+ lastSlash = i;
76
+ dots = 0;
77
+ continue;
78
+ } else if (res.length === 2 || res.length === 1) {
79
+ res = "";
80
+ lastSegmentLength = 0;
81
+ lastSlash = i;
82
+ dots = 0;
83
+ continue;
84
+ }
85
+ }
86
+ if (allowAboveRoot) {
87
+ if (res.length > 0) res += `${separator}..`;
88
+ else res = "..";
89
+ lastSegmentLength = 2;
90
+ }
91
+ } else {
92
+ if (res.length > 0) res += separator + path.slice(lastSlash + 1, i);
93
+ else res = path.slice(lastSlash + 1, i);
94
+ lastSegmentLength = i - lastSlash - 1;
95
+ }
96
+ lastSlash = i;
97
+ dots = 0;
98
+ } else if (code === CHAR_DOT && dots !== -1) {
99
+ ++dots;
100
+ } else {
101
+ dots = -1;
102
+ }
103
+ }
104
+ return res;
105
+ }
106
+
107
+ export function _format(
108
+ sep: string,
109
+ pathObject: FormatInputPathObject,
110
+ ): string {
111
+ const dir: string | undefined = pathObject.dir || pathObject.root;
112
+ const base: string = pathObject.base ||
113
+ (pathObject.name || "") + (pathObject.ext || "");
114
+ if (!dir) return base;
115
+ if (dir === pathObject.root) return dir + base;
116
+ return dir + sep + base;
117
+ }
118
+
119
+ const WHITESPACE_ENCODINGS: Record<string, string> = {
120
+ "\u0009": "%09",
121
+ "\u000A": "%0A",
122
+ "\u000B": "%0B",
123
+ "\u000C": "%0C",
124
+ "\u000D": "%0D",
125
+ "\u0020": "%20",
126
+ };
127
+
128
+ export function encodeWhitespace(string: string): string {
129
+ return string.replaceAll(/[\s]/g, (c) => {
130
+ return WHITESPACE_ENCODINGS[c] ?? c;
131
+ });
132
+ }
.deno/deps/https/deno.land/7c84f0bf5dd8c48257088f96cefebf3520889c2938e74ef31eb5ca0ed3398b6e.metadata.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "headers": {
3
+ "via": "http/2 edgeproxy-h",
4
+ "server-timing": "fetchSource;dur=8",
5
+ "referrer-policy": "strict-origin-when-cross-origin",
6
+ "last-modified": "Fri, 02 Apr 2021 05:03:20 GMT",
7
+ "x-content-type-options": "nosniff",
8
+ "accept-ranges": "bytes",
9
+ "cross-origin-opener-policy": "same-origin",
10
+ "cross-origin-resource-policy": "same-origin",
11
+ "vary": "Accept-Encoding, Origin",
12
+ "x-amz-cf-pop": "SEA73-P3",
13
+ "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
14
+ "content-type": "application/typescript; charset=utf-8",
15
+ "server": "deno/gcp-us-west1",
16
+ "access-control-allow-origin": "*",
17
+ "x-frame-options": "DENY",
18
+ "cache-control": "public, max-age=31536000, immutable",
19
+ "x-amz-cf-id": "6fy5WsH5xPeS22L-hfsPv0tw8qb7J5uMhlMggRAjhHe8TPIkLSmZlw==",
20
+ "x-amz-version-id": "aPCIHJ0Y.kD2tu2QZX2CR3fhvBRkArL1",
21
+ "etag": "\"f51756a231555d88825200cd1bb125b8\"",
22
+ "age": "28911890",
23
+ "date": "Sun, 16 Oct 2022 01:54:07 GMT",
24
+ "strict-transport-security": "max-age=63072000; includeSubDomains; preload",
25
+ "x-amz-replication-status": "FAILED",
26
+ "content-length": "3706",
27
+ "x-cache": "Hit from cloudfront",
28
+ "cross-origin-embedder-policy": "same-origin"
29
+ },
30
+ "url": "https://deno.land/std@0.92.0/path/_util.ts",
31
+ "now": {
32
+ "secs_since_epoch": 1694797136,
33
+ "nanos_since_epoch": 46025834
34
+ }
35
+ }
.deno/deps/https/deno.land/7f0ddf903842574b2a331f7a10a8601cc3b6930a32846329b7c607402db08f1b ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Ported from: https://github.com/jshttp/mime-types and licensed as:
3
+ *
4
+ * (The MIT License)
5
+ *
6
+ * Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
7
+ * Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
8
+ * Copyright (c) 2020 the Deno authors
9
+ * Copyright (c) 2020 the oak authors
10
+ *
11
+ * Permission is hereby granted, free of charge, to any person obtaining
12
+ * a copy of this software and associated documentation files (the
13
+ * 'Software'), to deal in the Software without restriction, including
14
+ * without limitation the rights to use, copy, modify, merge, publish,
15
+ * distribute, sublicense, and/or sell copies of the Software, and to
16
+ * permit persons to whom the Software is furnished to do so, subject to
17
+ * the following conditions:
18
+ *
19
+ * The above copyright notice and this permission notice shall be
20
+ * included in all copies or substantial portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
23
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
26
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
27
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
28
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
+ */
30
+
31
+ import { db } from "./db.ts";
32
+ import { extname } from "./deps.ts";
33
+
34
+ const EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
35
+ const TEXT_TYPE_REGEXP = /^text\//i;
36
+
37
+ /** A map of extensions for a given media type */
38
+ export const extensions = new Map<string, string[]>();
39
+
40
+ /** A map of the media type for a given extension */
41
+ export const types = new Map<string, string>();
42
+
43
+ /** Internal function to populate the maps based on the Mime DB */
44
+ function populateMaps(
45
+ extensions: Map<string, string[]>,
46
+ types: Map<string, string>,
47
+ ): void {
48
+ const preference = ["nginx", "apache", undefined, "iana"];
49
+
50
+ for (const type of Object.keys(db)) {
51
+ const mime = db[type];
52
+ const exts = mime.extensions;
53
+
54
+ if (!exts || !exts.length) {
55
+ continue;
56
+ }
57
+
58
+ extensions.set(type, exts);
59
+
60
+ for (const ext of exts) {
61
+ const current = types.get(ext);
62
+ if (current) {
63
+ const from = preference.indexOf(db[current].source);
64
+ const to = preference.indexOf(mime.source);
65
+
66
+ if (
67
+ current !== "application/octet-stream" &&
68
+ (from > to ||
69
+ (from === to && current.substr(0, 12) === "application/"))
70
+ ) {
71
+ continue;
72
+ }
73
+ }
74
+
75
+ types.set(ext, type);
76
+ }
77
+ }
78
+ }
79
+
80
+ // Populate the maps upon module load
81
+ populateMaps(extensions, types);
82
+
83
+ /** Given a media type return any default charset string. Returns `undefined`
84
+ * if not resolvable.
85
+ */
86
+ export function charset(type: string): string | undefined {
87
+ const m = EXTRACT_TYPE_REGEXP.exec(type);
88
+ if (!m) {
89
+ return undefined;
90
+ }
91
+ const [match] = m;
92
+ const mime = db[match.toLowerCase()];
93
+
94
+ if (mime && mime.charset) {
95
+ return mime.charset;
96
+ }
97
+
98
+ if (TEXT_TYPE_REGEXP.test(match)) {
99
+ return "UTF-8";
100
+ }
101
+
102
+ return undefined;
103
+ }
104
+
105
+ /** Given an extension, lookup the appropriate media type for that extension.
106
+ * Likely you should be using `contentType()` though instead.
107
+ */
108
+ export function lookup(path: string): string | undefined {
109
+ const extension = extname("x." + path)
110
+ .toLowerCase()
111
+ .substr(1);
112
+
113
+ return types.get(extension);
114
+ }
115
+
116
+ /** Given an extension or media type, return the full `Content-Type` header
117
+ * string. Returns `undefined` if not resolvable.
118
+ */
119
+ export function contentType(str: string): string | undefined {
120
+ let mime = str.includes("/") ? str : lookup(str);
121
+
122
+ if (!mime) {
123
+ return undefined;
124
+ }
125
+
126
+ if (!mime.includes("charset")) {
127
+ const cs = charset(mime);
128
+ if (cs) {
129
+ mime += `; charset=${cs.toLowerCase()}`;
130
+ }
131
+ }
132
+
133
+ return mime;
134
+ }
135
+
136
+ /** Given a media type, return the most appropriate extension or return
137
+ * `undefined` if there is none.
138
+ */
139
+ export function extension(type: string): string | undefined {
140
+ const match = EXTRACT_TYPE_REGEXP.exec(type);
141
+
142
+ if (!match) {
143
+ return undefined;
144
+ }
145
+
146
+ const exts = extensions.get(match[1].toLowerCase());
147
+
148
+ if (!exts || !exts.length) {
149
+ return undefined;
150
+ }
151
+
152
+ return exts[0];
153
+ }
.deno/deps/https/deno.land/7f0ddf903842574b2a331f7a10a8601cc3b6930a32846329b7c607402db08f1b.metadata.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "headers": {
3
+ "etag": "\"e7fbec37577c75cd38625a8dfb6bb80c\"",
4
+ "cross-origin-resource-policy": "same-origin",
5
+ "x-frame-options": "DENY",
6
+ "cross-origin-embedder-policy": "same-origin",
7
+ "x-amz-cf-pop": "SEA73-P3",
8
+ "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
9
+ "access-control-allow-origin": "*",
10
+ "last-modified": "Thu, 21 Jan 2021 22:00:01 GMT",
11
+ "age": "29184345",
12
+ "via": "http/2 edgeproxy",
13
+ "referrer-policy": "strict-origin-when-cross-origin",
14
+ "cache-control": "public, max-age=31536000, immutable",
15
+ "server": "deno/gcp-us-west1",
16
+ "server-timing": "fetchSource;dur=8",
17
+ "strict-transport-security": "max-age=63072000; includeSubDomains; preload",
18
+ "x-amz-cf-id": "zO17KixM5csy_GHnaXNwG1T3Sg0ovZI9E9w5p0q4Ft9hNMBIrN63TQ==",
19
+ "x-amz-version-id": "K4jtseUmiRsDqkrvlgxIOZWxs5t34jM4",
20
+ "x-cache": "Hit from cloudfront",
21
+ "content-type": "application/typescript; charset=utf-8",
22
+ "date": "Wed, 12 Oct 2022 22:13:11 GMT",
23
+ "vary": "Accept-Encoding, Origin",
24
+ "cross-origin-opener-policy": "same-origin",
25
+ "accept-ranges": "bytes",
26
+ "x-amz-replication-status": "FAILED",
27
+ "content-length": "4317",
28
+ "x-content-type-options": "nosniff"
29
+ },
30
+ "url": "https://deno.land/x/media_types@v2.7.1/mod.ts",
31
+ "now": {
32
+ "secs_since_epoch": 1694797135,
33
+ "nanos_since_epoch": 500065859
34
+ }
35
+ }
.deno/deps/https/deno.land/7fafc2af7ec45b2c2974a99211673659bce419c1811d4c7d030f7d8ffd7bcc19 ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+
4
+ import { SEP } from "./separator.ts";
5
+
6
+ /** Determines the common path from a set of paths, using an optional separator,
7
+ * which defaults to the OS default separator.
8
+ *
9
+ * import { common } from "https://deno.land/std/path/mod.ts";
10
+ * const p = common([
11
+ * "./deno/std/path/mod.ts",
12
+ * "./deno/std/fs/mod.ts",
13
+ * ]);
14
+ * console.log(p); // "./deno/std/"
15
+ *
16
+ */
17
+ export function common(paths: string[], sep = SEP): string {
18
+ const [first = "", ...remaining] = paths;
19
+ if (first === "" || remaining.length === 0) {
20
+ return first.substring(0, first.lastIndexOf(sep) + 1);
21
+ }
22
+ const parts = first.split(sep);
23
+
24
+ let endOfPrefix = parts.length;
25
+ for (const path of remaining) {
26
+ const compare = path.split(sep);
27
+ for (let i = 0; i < endOfPrefix; i++) {
28
+ if (compare[i] !== parts[i]) {
29
+ endOfPrefix = i;
30
+ }
31
+ }
32
+
33
+ if (endOfPrefix === 0) {
34
+ return "";
35
+ }
36
+ }
37
+ const prefix = parts.slice(0, endOfPrefix).join(sep);
38
+ return prefix.endsWith(sep) ? prefix : `${prefix}${sep}`;
39
+ }
.deno/deps/https/deno.land/7fafc2af7ec45b2c2974a99211673659bce419c1811d4c7d030f7d8ffd7bcc19.metadata.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "headers": {
3
+ "x-amz-cf-pop": "SEA73-P3",
4
+ "x-amz-replication-status": "FAILED",
5
+ "x-amz-cf-id": "bn9JRwODH5e0QWiywRFWGODbHhQhcwO5Qba5EJiDMqXPd_UHfDsG6g==",
6
+ "cross-origin-embedder-policy": "same-origin",
7
+ "x-amz-version-id": "2DH2gNqw0Do7JdmTRJ1SeZABkGPL3ntR",
8
+ "x-content-type-options": "nosniff",
9
+ "x-cache": "Hit from cloudfront",
10
+ "server": "deno/gcp-us-west1",
11
+ "etag": "\"563fa4ed09afad6fac675949f387b257\"",
12
+ "age": "28911889",
13
+ "date": "Sun, 16 Oct 2022 01:54:07 GMT",
14
+ "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
15
+ "content-type": "application/typescript; charset=utf-8",
16
+ "x-frame-options": "DENY",
17
+ "cross-origin-resource-policy": "same-origin",
18
+ "last-modified": "Fri, 02 Apr 2021 05:03:20 GMT",
19
+ "referrer-policy": "strict-origin-when-cross-origin",
20
+ "via": "http/2 edgeproxy-h",
21
+ "accept-ranges": "bytes",
22
+ "access-control-allow-origin": "*",
23
+ "cache-control": "public, max-age=31536000, immutable",
24
+ "content-length": "1166",
25
+ "cross-origin-opener-policy": "same-origin",
26
+ "server-timing": "fetchSource;dur=14",
27
+ "strict-transport-security": "max-age=63072000; includeSubDomains; preload",
28
+ "vary": "Accept-Encoding, Origin"
29
+ },
30
+ "url": "https://deno.land/std@0.92.0/path/common.ts",
31
+ "now": {
32
+ "secs_since_epoch": 1694797135,
33
+ "nanos_since_epoch": 856729975
34
+ }
35
+ }