typenative 0.6.2 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1131) hide show
  1. package/README.md +1 -1
  2. package/bin/cli.js +18 -8
  3. package/bin/go/overrides.js +21 -1
  4. package/bin/index.js +48 -25
  5. package/bin/main.js +2 -1
  6. package/bin/node/assert.js +56 -17
  7. package/bin/node/async_hooks.js +69 -10
  8. package/bin/node/buffer.js +321 -7
  9. package/bin/node/child_process.js +220 -16
  10. package/bin/node/cluster.js +436 -32
  11. package/bin/node/crypto.js +814 -5
  12. package/bin/node/crypto_curves.js +142 -0
  13. package/bin/node/crypto_keys.js +1147 -48
  14. package/bin/node/crypto_pem.js +313 -0
  15. package/bin/node/crypto_pkcs12.js +17 -0
  16. package/bin/node/dgram.js +161 -10
  17. package/bin/node/diagnostics_channel.js +5 -1
  18. package/bin/node/events.js +358 -8
  19. package/bin/node/ffi.js +933 -0
  20. package/bin/node/fs.js +1346 -10
  21. package/bin/node/histogram.js +1991 -0
  22. package/bin/node/http.js +630 -55
  23. package/bin/node/http2.js +1141 -88
  24. package/bin/node/intl.js +4576 -0
  25. package/bin/node/intl_data.js +65412 -0
  26. package/bin/node/module_v8.js +155 -16
  27. package/bin/node/net.js +59 -10
  28. package/bin/node/path.js +5 -1
  29. package/bin/node/process.js +355 -4
  30. package/bin/node/readline.js +558 -8
  31. package/bin/node/registry.js +2 -0
  32. package/bin/node/sqlite.js +1539 -7
  33. package/bin/node/stream.js +371 -32
  34. package/bin/node/stream_web.js +422 -15
  35. package/bin/node/system_extra.js +40 -154
  36. package/bin/node/temporal.js +96 -0
  37. package/bin/node/temporal_runtime.js +5075 -0
  38. package/bin/node/temporal_zones.js +460 -0
  39. package/bin/node/test.js +191 -8
  40. package/bin/node/test_coverage.js +58 -0
  41. package/bin/node/test_report.js +50 -4
  42. package/bin/node/test_run.js +64 -3
  43. package/bin/node/timers.js +123 -0
  44. package/bin/node/tls.js +346 -12
  45. package/bin/node/tls_roots.js +122 -0
  46. package/bin/node/typed_arrays.js +867 -93
  47. package/bin/node/url.js +657 -0
  48. package/bin/node/util.js +449 -7
  49. package/bin/node/util_extra.js +6 -0
  50. package/bin/node/wasi.js +214 -0
  51. package/bin/node/webassembly.js +1137 -0
  52. package/bin/node/websocket.js +763 -0
  53. package/bin/node/webview.js +3257 -244
  54. package/bin/node/worker_threads.js +434 -52
  55. package/bin/node/zlib.js +455 -22
  56. package/bin/node/zlib_iter.js +585 -0
  57. package/bin/node/zlib_zip.js +2392 -0
  58. package/bin/transpiler.js +3417 -501
  59. package/bin/typecheck-node.js +49 -17
  60. package/bin/version.js +1 -1
  61. package/govendor/github.com/cloudflare/circl/.golangci.yaml +64 -0
  62. package/govendor/github.com/cloudflare/circl/.semgrepignore +1 -0
  63. package/govendor/github.com/cloudflare/circl/AGENTS.md +91 -0
  64. package/govendor/github.com/cloudflare/circl/CITATION.cff +30 -0
  65. package/govendor/github.com/cloudflare/circl/LICENSE +57 -0
  66. package/govendor/github.com/cloudflare/circl/Makefile +70 -0
  67. package/govendor/github.com/cloudflare/circl/README.md +206 -0
  68. package/govendor/github.com/cloudflare/circl/REVIEW.md +83 -0
  69. package/govendor/github.com/cloudflare/circl/codecov.yml +21 -0
  70. package/govendor/github.com/cloudflare/circl/dh/x448/curve.go +104 -0
  71. package/govendor/github.com/cloudflare/circl/dh/x448/curve_amd64.go +30 -0
  72. package/govendor/github.com/cloudflare/circl/dh/x448/curve_amd64.h +111 -0
  73. package/govendor/github.com/cloudflare/circl/dh/x448/curve_amd64.s +194 -0
  74. package/govendor/github.com/cloudflare/circl/dh/x448/curve_generic.go +100 -0
  75. package/govendor/github.com/cloudflare/circl/dh/x448/curve_noasm.go +11 -0
  76. package/govendor/github.com/cloudflare/circl/dh/x448/doc.go +19 -0
  77. package/govendor/github.com/cloudflare/circl/dh/x448/key.go +46 -0
  78. package/govendor/github.com/cloudflare/circl/dh/x448/table.go +460 -0
  79. package/govendor/github.com/cloudflare/circl/doc.go +8 -0
  80. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/constants.go +71 -0
  81. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/curve.go +90 -0
  82. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/isogeny.go +52 -0
  83. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/point.go +181 -0
  84. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/scalar.go +203 -0
  85. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/twist.go +138 -0
  86. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/twistPoint.go +135 -0
  87. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/twistTables.go +216 -0
  88. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/twist_basemult.go +62 -0
  89. package/govendor/github.com/cloudflare/circl/go.mod +3 -0
  90. package/govendor/github.com/cloudflare/circl/internal/conv/conv.go +173 -0
  91. package/govendor/github.com/cloudflare/circl/internal/sha3/doc.go +62 -0
  92. package/govendor/github.com/cloudflare/circl/internal/sha3/hashes.go +69 -0
  93. package/govendor/github.com/cloudflare/circl/internal/sha3/keccakf.go +391 -0
  94. package/govendor/github.com/cloudflare/circl/internal/sha3/rc.go +29 -0
  95. package/govendor/github.com/cloudflare/circl/internal/sha3/sha3.go +200 -0
  96. package/govendor/github.com/cloudflare/circl/internal/sha3/sha3_s390x.s +33 -0
  97. package/govendor/github.com/cloudflare/circl/internal/sha3/shake.go +119 -0
  98. package/govendor/github.com/cloudflare/circl/internal/sha3/xor.go +15 -0
  99. package/govendor/github.com/cloudflare/circl/internal/sha3/xor_generic.go +33 -0
  100. package/govendor/github.com/cloudflare/circl/internal/sha3/xor_unaligned.go +61 -0
  101. package/govendor/github.com/cloudflare/circl/math/fp448/fp.go +164 -0
  102. package/govendor/github.com/cloudflare/circl/math/fp448/fp_amd64.go +43 -0
  103. package/govendor/github.com/cloudflare/circl/math/fp448/fp_amd64.h +591 -0
  104. package/govendor/github.com/cloudflare/circl/math/fp448/fp_amd64.s +75 -0
  105. package/govendor/github.com/cloudflare/circl/math/fp448/fp_generic.go +339 -0
  106. package/govendor/github.com/cloudflare/circl/math/fp448/fp_noasm.go +12 -0
  107. package/govendor/github.com/cloudflare/circl/math/fp448/fuzzer.go +75 -0
  108. package/govendor/github.com/cloudflare/circl/math/integer.go +16 -0
  109. package/govendor/github.com/cloudflare/circl/math/mlsbset/mlsbset.go +145 -0
  110. package/govendor/github.com/cloudflare/circl/math/mlsbset/power.go +64 -0
  111. package/govendor/github.com/cloudflare/circl/math/primes.go +34 -0
  112. package/govendor/github.com/cloudflare/circl/math/wnaf.go +84 -0
  113. package/govendor/github.com/cloudflare/circl/sign/ed448/ed448.go +417 -0
  114. package/govendor/github.com/cloudflare/circl/sign/ed448/signapi.go +89 -0
  115. package/govendor/github.com/cloudflare/circl/sign/sign.go +119 -0
  116. package/{examples/react-compiler/vendor/picocolors → govendor/github.com/decred/dcrd/dcrec/secp256k1/v4}/LICENSE +4 -2
  117. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/README.md +72 -0
  118. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/compressedbytepoints.go +18 -0
  119. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/curve.go +1310 -0
  120. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/curve_embedded.go +14 -0
  121. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/curve_precompute.go +14 -0
  122. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/doc.go +59 -0
  123. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/ecdh.go +21 -0
  124. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa/README.md +52 -0
  125. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa/doc.go +42 -0
  126. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa/error.go +134 -0
  127. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa/signature.go +1001 -0
  128. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/ellipticadaptor.go +296 -0
  129. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/error.go +67 -0
  130. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/field.go +1696 -0
  131. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/go.mod +3 -0
  132. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/loadprecomputed.go +91 -0
  133. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/modnscalar.go +1105 -0
  134. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/nonce.go +263 -0
  135. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/privkey.go +111 -0
  136. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/pubkey.go +236 -0
  137. package/govendor/github.com/ebitengine/purego/LICENSE +201 -0
  138. package/govendor/github.com/ebitengine/purego/README.md +124 -0
  139. package/govendor/github.com/ebitengine/purego/abi_amd64.h +99 -0
  140. package/govendor/github.com/ebitengine/purego/abi_arm64.h +39 -0
  141. package/govendor/github.com/ebitengine/purego/abi_loong64.h +60 -0
  142. package/govendor/github.com/ebitengine/purego/cdecl.go +11 -0
  143. package/govendor/github.com/ebitengine/purego/cgo.go +19 -0
  144. package/govendor/github.com/ebitengine/purego/dlerror.go +17 -0
  145. package/govendor/github.com/ebitengine/purego/dlfcn.go +99 -0
  146. package/govendor/github.com/ebitengine/purego/dlfcn_android.go +34 -0
  147. package/govendor/github.com/ebitengine/purego/dlfcn_darwin.go +20 -0
  148. package/govendor/github.com/ebitengine/purego/dlfcn_freebsd.go +14 -0
  149. package/govendor/github.com/ebitengine/purego/dlfcn_linux.go +16 -0
  150. package/govendor/github.com/ebitengine/purego/dlfcn_netbsd.go +15 -0
  151. package/govendor/github.com/ebitengine/purego/dlfcn_nocgo_freebsd.go +11 -0
  152. package/govendor/github.com/ebitengine/purego/dlfcn_nocgo_linux.go +19 -0
  153. package/govendor/github.com/ebitengine/purego/dlfcn_nocgo_netbsd.go +11 -0
  154. package/govendor/github.com/ebitengine/purego/dlfcn_playground.go +24 -0
  155. package/govendor/github.com/ebitengine/purego/dlfcn_stubs.s +22 -0
  156. package/govendor/github.com/ebitengine/purego/func.go +780 -0
  157. package/govendor/github.com/ebitengine/purego/gen.go +6 -0
  158. package/govendor/github.com/ebitengine/purego/go.mod +3 -0
  159. package/govendor/github.com/ebitengine/purego/go_runtime.go +19 -0
  160. package/govendor/github.com/ebitengine/purego/internal/cgo/dlfcn_cgo_unix.go +56 -0
  161. package/govendor/github.com/ebitengine/purego/internal/cgo/empty.go +6 -0
  162. package/govendor/github.com/ebitengine/purego/internal/cgo/syscall_cgo_unix.go +49 -0
  163. package/govendor/github.com/ebitengine/purego/internal/fakecgo/abi_amd64.h +99 -0
  164. package/govendor/github.com/ebitengine/purego/internal/fakecgo/abi_arm64.h +39 -0
  165. package/govendor/github.com/ebitengine/purego/internal/fakecgo/abi_loong64.h +60 -0
  166. package/govendor/github.com/ebitengine/purego/internal/fakecgo/abi_ppc64x.h +195 -0
  167. package/govendor/github.com/ebitengine/purego/internal/fakecgo/abi_riscv64.h +72 -0
  168. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_386.s +29 -0
  169. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_amd64.s +39 -0
  170. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_arm.s +58 -0
  171. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_arm64.s +35 -0
  172. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_loong64.s +38 -0
  173. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_ppc64le.s +79 -0
  174. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_riscv64.s +36 -0
  175. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_s390x.s +52 -0
  176. package/govendor/github.com/ebitengine/purego/internal/fakecgo/callbacks.go +93 -0
  177. package/govendor/github.com/ebitengine/purego/internal/fakecgo/doc.go +32 -0
  178. package/govendor/github.com/ebitengine/purego/internal/fakecgo/fakecgo.go +14 -0
  179. package/govendor/github.com/ebitengine/purego/internal/fakecgo/freebsd.go +27 -0
  180. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_darwin.go +86 -0
  181. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_freebsd.go +77 -0
  182. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_libinit.go +72 -0
  183. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_linux.go +77 -0
  184. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_netbsd.go +83 -0
  185. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_setenv.go +18 -0
  186. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_util.go +38 -0
  187. package/govendor/github.com/ebitengine/purego/internal/fakecgo/iscgo.go +19 -0
  188. package/govendor/github.com/ebitengine/purego/internal/fakecgo/libcgo.go +37 -0
  189. package/govendor/github.com/ebitengine/purego/internal/fakecgo/libcgo_darwin.go +37 -0
  190. package/govendor/github.com/ebitengine/purego/internal/fakecgo/libcgo_freebsd.go +27 -0
  191. package/govendor/github.com/ebitengine/purego/internal/fakecgo/libcgo_linux.go +27 -0
  192. package/govendor/github.com/ebitengine/purego/internal/fakecgo/libcgo_netbsd.go +36 -0
  193. package/govendor/github.com/ebitengine/purego/internal/fakecgo/linux.go +189 -0
  194. package/govendor/github.com/ebitengine/purego/internal/fakecgo/netbsd.go +23 -0
  195. package/govendor/github.com/ebitengine/purego/internal/fakecgo/setenv.go +19 -0
  196. package/govendor/github.com/ebitengine/purego/internal/fakecgo/threadentry_amd64.go +15 -0
  197. package/govendor/github.com/ebitengine/purego/internal/fakecgo/threadentry_noasm.go +24 -0
  198. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_386.s +130 -0
  199. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_amd64.s +124 -0
  200. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_arm.s +131 -0
  201. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_arm64.s +81 -0
  202. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_386.s +78 -0
  203. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_amd64.s +69 -0
  204. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_arm.s +69 -0
  205. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_arm64.s +60 -0
  206. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_loong64.s +60 -0
  207. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_ppc64le.s +69 -0
  208. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_riscv64.s +60 -0
  209. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_s390x.s +51 -0
  210. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_loong64.s +78 -0
  211. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_ppc64le.s +132 -0
  212. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_riscv64.s +76 -0
  213. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_s390x.s +158 -0
  214. package/govendor/github.com/ebitengine/purego/internal/fakecgo/zsymbols.go +165 -0
  215. package/govendor/github.com/ebitengine/purego/internal/fakecgo/zsymbols_darwin.go +59 -0
  216. package/govendor/github.com/ebitengine/purego/internal/fakecgo/zsymbols_freebsd.go +48 -0
  217. package/govendor/github.com/ebitengine/purego/internal/fakecgo/zsymbols_linux.go +158 -0
  218. package/govendor/github.com/ebitengine/purego/internal/fakecgo/zsymbols_netbsd.go +59 -0
  219. package/govendor/github.com/ebitengine/purego/internal/fakecgo/ztrampolines_darwin.s +19 -0
  220. package/govendor/github.com/ebitengine/purego/internal/fakecgo/ztrampolines_freebsd.s +16 -0
  221. package/govendor/github.com/ebitengine/purego/internal/fakecgo/ztrampolines_linux.s +46 -0
  222. package/govendor/github.com/ebitengine/purego/internal/fakecgo/ztrampolines_netbsd.s +19 -0
  223. package/govendor/github.com/ebitengine/purego/internal/fakecgo/ztrampolines_stubs.s +55 -0
  224. package/govendor/github.com/ebitengine/purego/internal/strings/strings.go +40 -0
  225. package/govendor/github.com/ebitengine/purego/is_ios.go +13 -0
  226. package/govendor/github.com/ebitengine/purego/nocgo.go +25 -0
  227. package/govendor/github.com/ebitengine/purego/struct_amd64.go +518 -0
  228. package/govendor/github.com/ebitengine/purego/struct_arm.go +100 -0
  229. package/govendor/github.com/ebitengine/purego/struct_arm64.go +757 -0
  230. package/govendor/github.com/ebitengine/purego/struct_loong64.go +244 -0
  231. package/govendor/github.com/ebitengine/purego/struct_other.go +54 -0
  232. package/govendor/github.com/ebitengine/purego/struct_ppc64le.go +180 -0
  233. package/govendor/github.com/ebitengine/purego/struct_riscv64.go +158 -0
  234. package/govendor/github.com/ebitengine/purego/struct_s390x.go +158 -0
  235. package/govendor/github.com/ebitengine/purego/sys_386.s +153 -0
  236. package/govendor/github.com/ebitengine/purego/sys_amd64.s +206 -0
  237. package/govendor/github.com/ebitengine/purego/sys_arm.s +153 -0
  238. package/govendor/github.com/ebitengine/purego/sys_arm64.s +133 -0
  239. package/govendor/github.com/ebitengine/purego/sys_loong64.s +131 -0
  240. package/govendor/github.com/ebitengine/purego/sys_ppc64le.s +126 -0
  241. package/govendor/github.com/ebitengine/purego/sys_riscv64.s +135 -0
  242. package/govendor/github.com/ebitengine/purego/sys_s390x.s +148 -0
  243. package/govendor/github.com/ebitengine/purego/sys_unix_386.s +234 -0
  244. package/govendor/github.com/ebitengine/purego/sys_unix_arm.s +99 -0
  245. package/govendor/github.com/ebitengine/purego/sys_unix_arm64.s +75 -0
  246. package/govendor/github.com/ebitengine/purego/sys_unix_loong64.s +79 -0
  247. package/govendor/github.com/ebitengine/purego/sys_unix_ppc64le.s +114 -0
  248. package/govendor/github.com/ebitengine/purego/sys_unix_riscv64.s +79 -0
  249. package/govendor/github.com/ebitengine/purego/sys_unix_s390x.s +111 -0
  250. package/govendor/github.com/ebitengine/purego/syscall.go +95 -0
  251. package/govendor/github.com/ebitengine/purego/syscall_32bit.go +97 -0
  252. package/govendor/github.com/ebitengine/purego/syscall_cgo_linux.go +20 -0
  253. package/govendor/github.com/ebitengine/purego/syscall_notstackargs.go +55 -0
  254. package/govendor/github.com/ebitengine/purego/syscall_ppc64le.go +73 -0
  255. package/govendor/github.com/ebitengine/purego/syscall_stackargs_ppc64le.go +38 -0
  256. package/govendor/github.com/ebitengine/purego/syscall_stackargs_s390x.go +38 -0
  257. package/govendor/github.com/ebitengine/purego/syscall_unix.go +392 -0
  258. package/govendor/github.com/ebitengine/purego/syscall_windows.go +54 -0
  259. package/govendor/github.com/ebitengine/purego/zcallback_386.s +4014 -0
  260. package/govendor/github.com/ebitengine/purego/zcallback_amd64.s +2014 -0
  261. package/govendor/github.com/ebitengine/purego/zcallback_arm.s +4014 -0
  262. package/govendor/github.com/ebitengine/purego/zcallback_arm64.s +4014 -0
  263. package/govendor/github.com/ebitengine/purego/zcallback_loong64.s +4014 -0
  264. package/govendor/github.com/ebitengine/purego/zcallback_ppc64le.s +4014 -0
  265. package/govendor/github.com/ebitengine/purego/zcallback_riscv64.s +4051 -0
  266. package/govendor/github.com/ebitengine/purego/zcallback_s390x.s +4015 -0
  267. package/govendor/github.com/klauspost/compress/.gitattributes +3 -0
  268. package/govendor/github.com/klauspost/compress/.goreleaser.yml +132 -0
  269. package/govendor/github.com/klauspost/compress/AGENTS.md +106 -0
  270. package/govendor/github.com/klauspost/compress/LICENSE +304 -0
  271. package/govendor/github.com/klauspost/compress/README.md +766 -0
  272. package/govendor/github.com/klauspost/compress/SECURITY.md +25 -0
  273. package/govendor/github.com/klauspost/compress/compressible.go +85 -0
  274. package/govendor/github.com/klauspost/compress/fse/README.md +79 -0
  275. package/govendor/github.com/klauspost/compress/fse/bitreader.go +122 -0
  276. package/govendor/github.com/klauspost/compress/fse/bitwriter.go +167 -0
  277. package/govendor/github.com/klauspost/compress/fse/bytereader.go +47 -0
  278. package/govendor/github.com/klauspost/compress/fse/compress.go +685 -0
  279. package/govendor/github.com/klauspost/compress/fse/decompress.go +383 -0
  280. package/govendor/github.com/klauspost/compress/fse/fse.go +150 -0
  281. package/govendor/github.com/klauspost/compress/gen.sh +4 -0
  282. package/govendor/github.com/klauspost/compress/go.mod +3 -0
  283. package/govendor/github.com/klauspost/compress/huff0/README.md +89 -0
  284. package/govendor/github.com/klauspost/compress/huff0/bitreader.go +323 -0
  285. package/govendor/github.com/klauspost/compress/huff0/bitwriter.go +97 -0
  286. package/govendor/github.com/klauspost/compress/huff0/build_table.go +168 -0
  287. package/govendor/github.com/klauspost/compress/huff0/compress.go +747 -0
  288. package/govendor/github.com/klauspost/compress/huff0/decompress.go +1188 -0
  289. package/govendor/github.com/klauspost/compress/huff0/decompress_amd64.go +128 -0
  290. package/govendor/github.com/klauspost/compress/huff0/decompress_amd64.s +3476 -0
  291. package/govendor/github.com/klauspost/compress/huff0/decompress_arm64.go +72 -0
  292. package/govendor/github.com/klauspost/compress/huff0/decompress_arm64.s +1648 -0
  293. package/govendor/github.com/klauspost/compress/huff0/decompress_asm.go +252 -0
  294. package/govendor/github.com/klauspost/compress/huff0/decompress_generic.go +278 -0
  295. package/govendor/github.com/klauspost/compress/huff0/huff0.go +337 -0
  296. package/govendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go +34 -0
  297. package/govendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go +10 -0
  298. package/govendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s +34 -0
  299. package/govendor/github.com/klauspost/compress/internal/le/le.go +5 -0
  300. package/govendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go +42 -0
  301. package/govendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go +52 -0
  302. package/govendor/github.com/klauspost/compress/internal/regmask/regmask.go +50 -0
  303. package/govendor/github.com/klauspost/compress/internal/regmask/regmask_386.go +39 -0
  304. package/govendor/github.com/klauspost/compress/internal/snapref/LICENSE +27 -0
  305. package/govendor/github.com/klauspost/compress/internal/snapref/decode.go +264 -0
  306. package/govendor/github.com/klauspost/compress/internal/snapref/decode_other.go +113 -0
  307. package/govendor/github.com/klauspost/compress/internal/snapref/encode.go +291 -0
  308. package/govendor/github.com/klauspost/compress/internal/snapref/encode_other.go +250 -0
  309. package/govendor/github.com/klauspost/compress/internal/snapref/snappy.go +98 -0
  310. package/govendor/github.com/klauspost/compress/s2sx.mod +3 -0
  311. package/govendor/github.com/klauspost/compress/s2sx.sum +0 -0
  312. package/govendor/github.com/klauspost/compress/zstd/README.md +487 -0
  313. package/govendor/github.com/klauspost/compress/zstd/bitreader.go +176 -0
  314. package/govendor/github.com/klauspost/compress/zstd/bitwriter.go +151 -0
  315. package/govendor/github.com/klauspost/compress/zstd/blockdec.go +728 -0
  316. package/govendor/github.com/klauspost/compress/zstd/blockenc.go +923 -0
  317. package/govendor/github.com/klauspost/compress/zstd/blocktype_string.go +85 -0
  318. package/govendor/github.com/klauspost/compress/zstd/bytebuf.go +131 -0
  319. package/govendor/github.com/klauspost/compress/zstd/bytereader.go +82 -0
  320. package/govendor/github.com/klauspost/compress/zstd/decodeheader.go +261 -0
  321. package/govendor/github.com/klauspost/compress/zstd/decoder.go +995 -0
  322. package/govendor/github.com/klauspost/compress/zstd/decoder_options.go +213 -0
  323. package/govendor/github.com/klauspost/compress/zstd/dict.go +605 -0
  324. package/govendor/github.com/klauspost/compress/zstd/enc_base.go +200 -0
  325. package/govendor/github.com/klauspost/compress/zstd/enc_best.go +572 -0
  326. package/govendor/github.com/klauspost/compress/zstd/enc_better.go +1262 -0
  327. package/govendor/github.com/klauspost/compress/zstd/enc_dfast.go +1136 -0
  328. package/govendor/github.com/klauspost/compress/zstd/enc_fast.go +892 -0
  329. package/govendor/github.com/klauspost/compress/zstd/enc_jobs.go +352 -0
  330. package/govendor/github.com/klauspost/compress/zstd/encoder.go +881 -0
  331. package/govendor/github.com/klauspost/compress/zstd/encoder_options.go +422 -0
  332. package/govendor/github.com/klauspost/compress/zstd/framedec.go +404 -0
  333. package/govendor/github.com/klauspost/compress/zstd/frameenc.go +137 -0
  334. package/govendor/github.com/klauspost/compress/zstd/fse_decoder.go +333 -0
  335. package/govendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.s +132 -0
  336. package/govendor/github.com/klauspost/compress/zstd/fse_decoder_arm64.s +148 -0
  337. package/govendor/github.com/klauspost/compress/zstd/fse_decoder_asm.go +70 -0
  338. package/govendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go +71 -0
  339. package/govendor/github.com/klauspost/compress/zstd/fse_encoder.go +701 -0
  340. package/govendor/github.com/klauspost/compress/zstd/fse_predefined.go +168 -0
  341. package/govendor/github.com/klauspost/compress/zstd/hash.go +57 -0
  342. package/govendor/github.com/klauspost/compress/zstd/history.go +119 -0
  343. package/{examples/react-compiler/vendor/jsesc/LICENSE-MIT.txt → govendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt} +3 -1
  344. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md +71 -0
  345. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash.go +242 -0
  346. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s +210 -0
  347. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_arm64.s +184 -0
  348. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_asm.go +11 -0
  349. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go +75 -0
  350. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_safe.go +11 -0
  351. package/govendor/github.com/klauspost/compress/zstd/matchlen_amd64.go +15 -0
  352. package/govendor/github.com/klauspost/compress/zstd/matchlen_amd64.s +66 -0
  353. package/govendor/github.com/klauspost/compress/zstd/matchlen_generic.go +37 -0
  354. package/govendor/github.com/klauspost/compress/zstd/seqdec.go +620 -0
  355. package/govendor/github.com/klauspost/compress/zstd/seqdec_amd64.go +115 -0
  356. package/govendor/github.com/klauspost/compress/zstd/seqdec_amd64.s +4762 -0
  357. package/govendor/github.com/klauspost/compress/zstd/seqdec_arm64.go +81 -0
  358. package/govendor/github.com/klauspost/compress/zstd/seqdec_arm64.s +2919 -0
  359. package/govendor/github.com/klauspost/compress/zstd/seqdec_asm.go +327 -0
  360. package/govendor/github.com/klauspost/compress/zstd/seqdec_generic.go +258 -0
  361. package/govendor/github.com/klauspost/compress/zstd/seqenc.go +159 -0
  362. package/govendor/github.com/klauspost/compress/zstd/simple.go +54 -0
  363. package/govendor/github.com/klauspost/compress/zstd/snappy.go +447 -0
  364. package/govendor/github.com/klauspost/compress/zstd/zip.go +141 -0
  365. package/govendor/github.com/klauspost/compress/zstd/zstd.go +126 -0
  366. package/govendor/github.com/tetratelabs/wazero/.editorconfig +7 -0
  367. package/govendor/github.com/tetratelabs/wazero/.gitattributes +2 -0
  368. package/govendor/github.com/tetratelabs/wazero/.gitmodules +3 -0
  369. package/govendor/github.com/tetratelabs/wazero/CONTRIBUTING.md +75 -0
  370. package/govendor/github.com/tetratelabs/wazero/LICENSE +201 -0
  371. package/govendor/github.com/tetratelabs/wazero/Makefile +385 -0
  372. package/govendor/github.com/tetratelabs/wazero/NOTICE +2 -0
  373. package/govendor/github.com/tetratelabs/wazero/RATIONALE.md +1577 -0
  374. package/govendor/github.com/tetratelabs/wazero/README.md +135 -0
  375. package/govendor/github.com/tetratelabs/wazero/api/features.go +228 -0
  376. package/govendor/github.com/tetratelabs/wazero/api/wasm.go +766 -0
  377. package/govendor/github.com/tetratelabs/wazero/builder.go +367 -0
  378. package/govendor/github.com/tetratelabs/wazero/cache.go +123 -0
  379. package/govendor/github.com/tetratelabs/wazero/codecov.yml +9 -0
  380. package/govendor/github.com/tetratelabs/wazero/config.go +899 -0
  381. package/govendor/github.com/tetratelabs/wazero/experimental/checkpoint.go +35 -0
  382. package/govendor/github.com/tetratelabs/wazero/experimental/close.go +63 -0
  383. package/govendor/github.com/tetratelabs/wazero/experimental/compilationworkers.go +19 -0
  384. package/govendor/github.com/tetratelabs/wazero/experimental/experimental.go +41 -0
  385. package/govendor/github.com/tetratelabs/wazero/experimental/features.go +39 -0
  386. package/govendor/github.com/tetratelabs/wazero/experimental/importresolver.go +19 -0
  387. package/govendor/github.com/tetratelabs/wazero/experimental/listener.go +324 -0
  388. package/govendor/github.com/tetratelabs/wazero/experimental/memory.go +52 -0
  389. package/govendor/github.com/tetratelabs/wazero/experimental/sys/dir.go +92 -0
  390. package/govendor/github.com/tetratelabs/wazero/experimental/sys/errno.go +98 -0
  391. package/govendor/github.com/tetratelabs/wazero/experimental/sys/error.go +45 -0
  392. package/govendor/github.com/tetratelabs/wazero/experimental/sys/file.go +356 -0
  393. package/govendor/github.com/tetratelabs/wazero/experimental/sys/fs.go +292 -0
  394. package/govendor/github.com/tetratelabs/wazero/experimental/sys/oflag.go +70 -0
  395. package/govendor/github.com/tetratelabs/wazero/experimental/sys/poll.go +48 -0
  396. package/govendor/github.com/tetratelabs/wazero/experimental/sys/syscall_errno.go +106 -0
  397. package/govendor/github.com/tetratelabs/wazero/experimental/sys/syscall_errno_notwindows.go +13 -0
  398. package/govendor/github.com/tetratelabs/wazero/experimental/sys/syscall_errno_unsupported.go +7 -0
  399. package/govendor/github.com/tetratelabs/wazero/experimental/sys/syscall_errno_windows.go +37 -0
  400. package/govendor/github.com/tetratelabs/wazero/experimental/sys/time.go +10 -0
  401. package/govendor/github.com/tetratelabs/wazero/experimental/sys/unimplemented.go +160 -0
  402. package/govendor/github.com/tetratelabs/wazero/fsconfig.go +213 -0
  403. package/govendor/github.com/tetratelabs/wazero/go.mod +3 -0
  404. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/args.go +97 -0
  405. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/clock.go +116 -0
  406. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/environ.go +100 -0
  407. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/fs.go +2015 -0
  408. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/poll.go +247 -0
  409. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/proc.go +44 -0
  410. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/random.go +55 -0
  411. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/sched.go +22 -0
  412. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/sock.go +188 -0
  413. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/wasi.go +314 -0
  414. package/govendor/github.com/tetratelabs/wazero/internal/descriptor/table.go +149 -0
  415. package/govendor/github.com/tetratelabs/wazero/internal/engine/interpreter/compiler.go +3884 -0
  416. package/govendor/github.com/tetratelabs/wazero/internal/engine/interpreter/format.go +22 -0
  417. package/govendor/github.com/tetratelabs/wazero/internal/engine/interpreter/interpreter.go +4963 -0
  418. package/govendor/github.com/tetratelabs/wazero/internal/engine/interpreter/operations.go +2978 -0
  419. package/govendor/github.com/tetratelabs/wazero/internal/engine/interpreter/signature.go +825 -0
  420. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/abi.go +170 -0
  421. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/backend.go +3 -0
  422. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/compiler.go +402 -0
  423. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/compiler_lower.go +226 -0
  424. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/go_call.go +33 -0
  425. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi.go +186 -0
  426. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi_entry_amd64.go +9 -0
  427. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi_entry_amd64.s +29 -0
  428. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi_entry_preamble.go +248 -0
  429. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi_go_call.go +440 -0
  430. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/cond.go +168 -0
  431. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/ext.go +35 -0
  432. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/instr.go +2495 -0
  433. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/instr_encoding.go +1714 -0
  434. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/lower_constant.go +71 -0
  435. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/lower_mem.go +187 -0
  436. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/machine.go +3782 -0
  437. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/machine_pro_epi_logue.go +334 -0
  438. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/machine_regalloc.go +352 -0
  439. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/machine_vec.go +992 -0
  440. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/operands.go +336 -0
  441. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/reg.go +181 -0
  442. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/stack.go +130 -0
  443. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi.go +376 -0
  444. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi_entry_arm64.go +9 -0
  445. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi_entry_arm64.s +29 -0
  446. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi_entry_preamble.go +233 -0
  447. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi_go_call.go +430 -0
  448. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/cond.go +215 -0
  449. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/instr.go +2562 -0
  450. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/instr_encoding.go +2357 -0
  451. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/lower_constant.go +301 -0
  452. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/lower_instr.go +2227 -0
  453. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/lower_instr_operands.go +340 -0
  454. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/lower_mem.go +451 -0
  455. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/machine.go +631 -0
  456. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/machine_pro_epi_logue.go +486 -0
  457. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/machine_regalloc.go +351 -0
  458. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/machine_relocation.go +128 -0
  459. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/reg.go +397 -0
  460. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/unwind_stack.go +84 -0
  461. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/machine.go +119 -0
  462. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/regalloc/api.go +124 -0
  463. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/regalloc/reg.go +123 -0
  464. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/regalloc/regalloc.go +1189 -0
  465. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/regalloc/regset.go +96 -0
  466. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/vdef.go +19 -0
  467. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/call_engine.go +884 -0
  468. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/engine.go +1008 -0
  469. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/engine_cache.go +347 -0
  470. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/entrypoint_amd64.go +13 -0
  471. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/entrypoint_arm64.go +13 -0
  472. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/entrypoint_other.go +15 -0
  473. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/frontend/frontend.go +663 -0
  474. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/frontend/lower.go +5045 -0
  475. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/frontend/misc.go +10 -0
  476. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/frontend/sort_id.go +13 -0
  477. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/hostmodule.go +88 -0
  478. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/isa_amd64.go +30 -0
  479. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/isa_arm64.go +32 -0
  480. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/isa_other.go +29 -0
  481. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/memmove.go +11 -0
  482. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/module_engine.go +403 -0
  483. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/basic_block.go +381 -0
  484. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/basic_block_sort.go +32 -0
  485. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/builder.go +790 -0
  486. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/cmp.go +107 -0
  487. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/funcref.go +12 -0
  488. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/instructions.go +3024 -0
  489. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/pass.go +393 -0
  490. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/pass_blk_layouts.go +334 -0
  491. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/pass_cfg.go +313 -0
  492. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/signature.go +49 -0
  493. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/ssa.go +14 -0
  494. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/type.go +115 -0
  495. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/vs.go +114 -0
  496. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/debug_options.go +189 -0
  497. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/exitcode.go +150 -0
  498. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/offsetdata.go +248 -0
  499. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/perfmap.go +96 -0
  500. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/perfmap_disabled.go +5 -0
  501. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/perfmap_enabled.go +5 -0
  502. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/pool.go +215 -0
  503. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/ptr.go +15 -0
  504. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/queue.go +26 -0
  505. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/resetmap.go +11 -0
  506. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/checkpoint.go +10 -0
  507. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/close.go +5 -0
  508. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/compilationworkers.go +6 -0
  509. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/expctxkeys.go +2 -0
  510. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/importresolver.go +6 -0
  511. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/listener.go +7 -0
  512. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/memory.go +4 -0
  513. package/govendor/github.com/tetratelabs/wazero/internal/filecache/compilationcache.go +42 -0
  514. package/govendor/github.com/tetratelabs/wazero/internal/filecache/file_cache.go +76 -0
  515. package/govendor/github.com/tetratelabs/wazero/internal/ieee754/ieee754.go +29 -0
  516. package/govendor/github.com/tetratelabs/wazero/internal/internalapi/internal.go +9 -0
  517. package/govendor/github.com/tetratelabs/wazero/internal/leb128/leb128.go +285 -0
  518. package/govendor/github.com/tetratelabs/wazero/internal/moremath/moremath.go +271 -0
  519. package/govendor/github.com/tetratelabs/wazero/internal/platform/cpuid.go +26 -0
  520. package/govendor/github.com/tetratelabs/wazero/internal/platform/cpuid_amd64.go +22 -0
  521. package/govendor/github.com/tetratelabs/wazero/internal/platform/cpuid_arm64.go +13 -0
  522. package/govendor/github.com/tetratelabs/wazero/internal/platform/cpuid_unsupported.go +5 -0
  523. package/govendor/github.com/tetratelabs/wazero/internal/platform/crypto.go +17 -0
  524. package/govendor/github.com/tetratelabs/wazero/internal/platform/mmap_linux.go +72 -0
  525. package/govendor/github.com/tetratelabs/wazero/internal/platform/mmap_other.go +19 -0
  526. package/govendor/github.com/tetratelabs/wazero/internal/platform/mmap_unix.go +14 -0
  527. package/govendor/github.com/tetratelabs/wazero/internal/platform/mmap_unsupported.go +22 -0
  528. package/govendor/github.com/tetratelabs/wazero/internal/platform/mmap_windows.go +31 -0
  529. package/govendor/github.com/tetratelabs/wazero/internal/platform/path.go +6 -0
  530. package/govendor/github.com/tetratelabs/wazero/internal/platform/path_windows.go +17 -0
  531. package/govendor/github.com/tetratelabs/wazero/internal/platform/platform.go +71 -0
  532. package/govendor/github.com/tetratelabs/wazero/internal/platform/time.go +76 -0
  533. package/govendor/github.com/tetratelabs/wazero/internal/platform/time_notwindows.go +11 -0
  534. package/govendor/github.com/tetratelabs/wazero/internal/platform/time_windows.go +40 -0
  535. package/govendor/github.com/tetratelabs/wazero/internal/sock/sock.go +89 -0
  536. package/govendor/github.com/tetratelabs/wazero/internal/sock/sock_supported.go +11 -0
  537. package/govendor/github.com/tetratelabs/wazero/internal/sock/sock_unsupported.go +10 -0
  538. package/govendor/github.com/tetratelabs/wazero/internal/sys/fs.go +458 -0
  539. package/govendor/github.com/tetratelabs/wazero/internal/sys/lazy.go +135 -0
  540. package/govendor/github.com/tetratelabs/wazero/internal/sys/stdio.go +125 -0
  541. package/govendor/github.com/tetratelabs/wazero/internal/sys/sys.go +228 -0
  542. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/adapter.go +105 -0
  543. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/datasync_linux.go +12 -0
  544. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/datasync_unsupported.go +14 -0
  545. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/dir.go +24 -0
  546. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/dirfs.go +137 -0
  547. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/file.go +576 -0
  548. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/file_unix.go +39 -0
  549. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/file_unsupported.go +28 -0
  550. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/file_windows.go +133 -0
  551. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/futimens.go +29 -0
  552. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_darwin.go +42 -0
  553. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_darwin.s +8 -0
  554. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_linux.go +38 -0
  555. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_unsupported.go +18 -0
  556. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_windows.go +42 -0
  557. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/ino_unix.go +22 -0
  558. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/ino_unsupported.go +17 -0
  559. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/ino_windows.go +28 -0
  560. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_unix.go +17 -0
  561. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_unsupported.go +13 -0
  562. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_windows.go +23 -0
  563. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/oflag.go +38 -0
  564. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_bsd.go +26 -0
  565. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_darwin.go +26 -0
  566. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_supported.go +30 -0
  567. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_unix.go +20 -0
  568. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_unsupported.go +16 -0
  569. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_windows.go +163 -0
  570. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/osfile.go +318 -0
  571. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/poll.go +17 -0
  572. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/poll_darwin.go +55 -0
  573. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/poll_darwin.s +8 -0
  574. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/poll_linux.go +57 -0
  575. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/poll_unsupported.go +12 -0
  576. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/poll_windows.go +224 -0
  577. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/readfs.go +117 -0
  578. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/rename_unix.go +16 -0
  579. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/rename_unsupported.go +16 -0
  580. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/rename_windows.go +55 -0
  581. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sock.go +186 -0
  582. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sock_supported.go +76 -0
  583. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sock_unix.go +48 -0
  584. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sock_unsupported.go +79 -0
  585. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sock_windows.go +80 -0
  586. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/stat.go +16 -0
  587. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/stat_supported.go +40 -0
  588. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/stat_unsupported.go +40 -0
  589. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/stat_windows.go +118 -0
  590. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sync.go +13 -0
  591. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sync_windows.go +20 -0
  592. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/syscall6_darwin.go +13 -0
  593. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sysfs.go +6 -0
  594. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/unlink_unix.go +17 -0
  595. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/unlink_unsupported.go +14 -0
  596. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/unlink_windows.go +25 -0
  597. package/govendor/github.com/tetratelabs/wazero/internal/u32/u32.go +11 -0
  598. package/govendor/github.com/tetratelabs/wazero/internal/u64/u64.go +15 -0
  599. package/govendor/github.com/tetratelabs/wazero/internal/version/version.go +52 -0
  600. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/args.go +6 -0
  601. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/clock.go +16 -0
  602. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/environ.go +6 -0
  603. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/errno.go +314 -0
  604. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/fs.go +164 -0
  605. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/poll.go +15 -0
  606. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/proc.go +6 -0
  607. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/random.go +3 -0
  608. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/rights.go +148 -0
  609. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/sched.go +3 -0
  610. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/sock.go +71 -0
  611. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/wasi.go +26 -0
  612. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/code.go +124 -0
  613. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/const_expr.go +116 -0
  614. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/custom.go +22 -0
  615. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/data.go +79 -0
  616. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/decoder.go +235 -0
  617. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/element.go +250 -0
  618. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/errors.go +11 -0
  619. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/export.go +32 -0
  620. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/function.go +56 -0
  621. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/global.go +50 -0
  622. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/header.go +9 -0
  623. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/import.go +68 -0
  624. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/limits.go +47 -0
  625. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/memory.go +42 -0
  626. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/names.go +151 -0
  627. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/section.go +309 -0
  628. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/table.go +79 -0
  629. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/value.go +97 -0
  630. package/govendor/github.com/tetratelabs/wazero/internal/wasm/const_expr.go +259 -0
  631. package/govendor/github.com/tetratelabs/wazero/internal/wasm/counts.go +53 -0
  632. package/govendor/github.com/tetratelabs/wazero/internal/wasm/engine.go +76 -0
  633. package/govendor/github.com/tetratelabs/wazero/internal/wasm/exception.go +9 -0
  634. package/govendor/github.com/tetratelabs/wazero/internal/wasm/func_validation.go +2804 -0
  635. package/govendor/github.com/tetratelabs/wazero/internal/wasm/function_definition.go +210 -0
  636. package/govendor/github.com/tetratelabs/wazero/internal/wasm/global.go +55 -0
  637. package/govendor/github.com/tetratelabs/wazero/internal/wasm/gofunc.go +279 -0
  638. package/govendor/github.com/tetratelabs/wazero/internal/wasm/host.go +179 -0
  639. package/govendor/github.com/tetratelabs/wazero/internal/wasm/instruction.go +1962 -0
  640. package/govendor/github.com/tetratelabs/wazero/internal/wasm/memory.go +475 -0
  641. package/govendor/github.com/tetratelabs/wazero/internal/wasm/memory_definition.go +128 -0
  642. package/govendor/github.com/tetratelabs/wazero/internal/wasm/module.go +1359 -0
  643. package/govendor/github.com/tetratelabs/wazero/internal/wasm/module_instance.go +251 -0
  644. package/govendor/github.com/tetratelabs/wazero/internal/wasm/module_instance_lookup.go +73 -0
  645. package/govendor/github.com/tetratelabs/wazero/internal/wasm/store.go +726 -0
  646. package/govendor/github.com/tetratelabs/wazero/internal/wasm/store_module_list.go +95 -0
  647. package/govendor/github.com/tetratelabs/wazero/internal/wasm/table.go +321 -0
  648. package/govendor/github.com/tetratelabs/wazero/internal/wasmdebug/debug.go +170 -0
  649. package/govendor/github.com/tetratelabs/wazero/internal/wasmdebug/dwarf.go +225 -0
  650. package/govendor/github.com/tetratelabs/wazero/internal/wasmruntime/errors.go +54 -0
  651. package/govendor/github.com/tetratelabs/wazero/netlify.toml +15 -0
  652. package/govendor/github.com/tetratelabs/wazero/runtime.go +399 -0
  653. package/govendor/github.com/tetratelabs/wazero/sys/clock.go +26 -0
  654. package/govendor/github.com/tetratelabs/wazero/sys/error.go +83 -0
  655. package/govendor/github.com/tetratelabs/wazero/sys/stat.go +105 -0
  656. package/govendor/github.com/tetratelabs/wazero/sys/stat_bsd.go +29 -0
  657. package/govendor/github.com/tetratelabs/wazero/sys/stat_posix.go +29 -0
  658. package/govendor/github.com/tetratelabs/wazero/sys/stat_unsupported.go +14 -0
  659. package/govendor/github.com/tetratelabs/wazero/sys/stat_windows.go +24 -0
  660. package/govendor/golang.org/x/crypto/LICENSE +27 -0
  661. package/govendor/golang.org/x/crypto/PATENTS +22 -0
  662. package/govendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go +46 -0
  663. package/govendor/golang.org/x/crypto/cryptobyte/asn1.go +825 -0
  664. package/govendor/golang.org/x/crypto/cryptobyte/builder.go +350 -0
  665. package/govendor/golang.org/x/crypto/cryptobyte/string.go +183 -0
  666. package/govendor/golang.org/x/crypto/go.mod +3 -0
  667. package/govendor/golang.org/x/crypto/pbkdf2/pbkdf2.go +30 -0
  668. package/govendor/golang.org/x/net/LICENSE +27 -0
  669. package/govendor/golang.org/x/net/PATENTS +22 -0
  670. package/govendor/golang.org/x/net/dns/dnsmessage/message.go +2733 -0
  671. package/govendor/golang.org/x/net/dns/dnsmessage/svcb.go +333 -0
  672. package/govendor/golang.org/x/net/go.mod +3 -0
  673. package/govendor/golang.org/x/net/http/httpguts/guts.go +50 -0
  674. package/govendor/golang.org/x/net/http/httpguts/httplex.go +347 -0
  675. package/govendor/golang.org/x/net/http2/README.md +19 -0
  676. package/govendor/golang.org/x/net/http2/ascii.go +65 -0
  677. package/govendor/golang.org/x/net/http2/ciphers.go +641 -0
  678. package/govendor/golang.org/x/net/http2/client_conn_pool.go +301 -0
  679. package/govendor/golang.org/x/net/http2/client_priority_go126.go +20 -0
  680. package/govendor/golang.org/x/net/http2/client_priority_go127.go +13 -0
  681. package/govendor/golang.org/x/net/http2/clientconn.go +57 -0
  682. package/govendor/golang.org/x/net/http2/config.go +171 -0
  683. package/govendor/golang.org/x/net/http2/config_go125.go +15 -0
  684. package/govendor/golang.org/x/net/http2/config_go126.go +15 -0
  685. package/govendor/golang.org/x/net/http2/databuffer.go +146 -0
  686. package/govendor/golang.org/x/net/http2/errors.go +145 -0
  687. package/govendor/golang.org/x/net/http2/flow.go +175 -0
  688. package/govendor/golang.org/x/net/http2/frame.go +1887 -0
  689. package/govendor/golang.org/x/net/http2/gotrack.go +181 -0
  690. package/govendor/golang.org/x/net/http2/hpack/encode.go +244 -0
  691. package/govendor/golang.org/x/net/http2/hpack/hpack.go +522 -0
  692. package/govendor/golang.org/x/net/http2/hpack/huffman.go +226 -0
  693. package/govendor/golang.org/x/net/http2/hpack/static_table.go +188 -0
  694. package/govendor/golang.org/x/net/http2/hpack/tables.go +426 -0
  695. package/govendor/golang.org/x/net/http2/http2.go +415 -0
  696. package/govendor/golang.org/x/net/http2/pipe.go +184 -0
  697. package/govendor/golang.org/x/net/http2/server.go +3239 -0
  698. package/govendor/golang.org/x/net/http2/server_common.go +268 -0
  699. package/govendor/golang.org/x/net/http2/server_wrap.go +217 -0
  700. package/govendor/golang.org/x/net/http2/transport.go +3084 -0
  701. package/govendor/golang.org/x/net/http2/transport_common.go +516 -0
  702. package/govendor/golang.org/x/net/http2/transport_wrap.go +583 -0
  703. package/govendor/golang.org/x/net/http2/unencrypted.go +32 -0
  704. package/govendor/golang.org/x/net/http2/write.go +381 -0
  705. package/govendor/golang.org/x/net/http2/writesched.go +253 -0
  706. package/govendor/golang.org/x/net/http2/writesched_common.go +90 -0
  707. package/govendor/golang.org/x/net/http2/writesched_priority_rfc7540.go +420 -0
  708. package/govendor/golang.org/x/net/http2/writesched_priority_rfc9218.go +226 -0
  709. package/govendor/golang.org/x/net/http2/writesched_random.go +81 -0
  710. package/govendor/golang.org/x/net/http2/writesched_roundrobin.go +121 -0
  711. package/govendor/golang.org/x/net/idna/idna.go +884 -0
  712. package/govendor/golang.org/x/net/idna/punycode.go +220 -0
  713. package/govendor/golang.org/x/net/idna/tables15.0.0.go +5144 -0
  714. package/govendor/golang.org/x/net/idna/tables17.0.0.go +5302 -0
  715. package/govendor/golang.org/x/net/idna/trie.go +51 -0
  716. package/govendor/golang.org/x/net/idna/trieval.go +119 -0
  717. package/govendor/golang.org/x/net/internal/httpcommon/README.md +7 -0
  718. package/govendor/golang.org/x/net/internal/httpcommon/ascii.go +53 -0
  719. package/govendor/golang.org/x/net/internal/httpcommon/gzip.go +132 -0
  720. package/govendor/golang.org/x/net/internal/httpcommon/headermap.go +115 -0
  721. package/govendor/golang.org/x/net/internal/httpcommon/request.go +503 -0
  722. package/govendor/golang.org/x/net/internal/httpsfv/httpsfv.go +665 -0
  723. package/govendor/golang.org/x/sys/cpu/asm_aix_ppc64.s +17 -0
  724. package/govendor/golang.org/x/sys/cpu/asm_darwin_arm64_gc.s +12 -0
  725. package/govendor/golang.org/x/sys/cpu/asm_darwin_x86_gc.s +17 -0
  726. package/govendor/golang.org/x/sys/cpu/byteorder.go +66 -0
  727. package/govendor/golang.org/x/sys/cpu/cpu.go +357 -0
  728. package/govendor/golang.org/x/sys/cpu/cpu_aix.go +33 -0
  729. package/govendor/golang.org/x/sys/cpu/cpu_arm.go +73 -0
  730. package/govendor/golang.org/x/sys/cpu/cpu_arm64.go +191 -0
  731. package/govendor/golang.org/x/sys/cpu/cpu_arm64.s +35 -0
  732. package/govendor/golang.org/x/sys/cpu/cpu_darwin_arm64.go +67 -0
  733. package/govendor/golang.org/x/sys/cpu/cpu_darwin_arm64_other.go +31 -0
  734. package/govendor/golang.org/x/sys/cpu/cpu_darwin_x86.go +61 -0
  735. package/govendor/golang.org/x/sys/cpu/cpu_gc_arm64.go +12 -0
  736. package/govendor/golang.org/x/sys/cpu/cpu_gc_riscv64.go +11 -0
  737. package/govendor/golang.org/x/sys/cpu/cpu_gc_s390x.go +21 -0
  738. package/govendor/golang.org/x/sys/cpu/cpu_gc_x86.go +15 -0
  739. package/govendor/golang.org/x/sys/cpu/cpu_gc_x86.s +26 -0
  740. package/govendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go +12 -0
  741. package/govendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go +22 -0
  742. package/govendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c +37 -0
  743. package/govendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go +25 -0
  744. package/govendor/golang.org/x/sys/cpu/cpu_linux.go +15 -0
  745. package/govendor/golang.org/x/sys/cpu/cpu_linux_arm.go +39 -0
  746. package/govendor/golang.org/x/sys/cpu/cpu_linux_arm64.go +120 -0
  747. package/govendor/golang.org/x/sys/cpu/cpu_linux_loong64.go +22 -0
  748. package/govendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go +22 -0
  749. package/govendor/golang.org/x/sys/cpu/cpu_linux_noinit.go +9 -0
  750. package/govendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go +34 -0
  751. package/govendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go +173 -0
  752. package/govendor/golang.org/x/sys/cpu/cpu_linux_s390x.go +40 -0
  753. package/govendor/golang.org/x/sys/cpu/cpu_loong64.go +62 -0
  754. package/govendor/golang.org/x/sys/cpu/cpu_loong64.s +13 -0
  755. package/govendor/golang.org/x/sys/cpu/cpu_mips64x.go +15 -0
  756. package/govendor/golang.org/x/sys/cpu/cpu_mipsx.go +11 -0
  757. package/govendor/golang.org/x/sys/cpu/cpu_netbsd_amd64.go +47 -0
  758. package/govendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go +173 -0
  759. package/govendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go +65 -0
  760. package/govendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.s +11 -0
  761. package/govendor/golang.org/x/sys/cpu/cpu_other_arm.go +9 -0
  762. package/govendor/golang.org/x/sys/cpu/cpu_other_arm64.go +11 -0
  763. package/govendor/golang.org/x/sys/cpu/cpu_other_mips64x.go +11 -0
  764. package/govendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go +12 -0
  765. package/govendor/golang.org/x/sys/cpu/cpu_other_riscv64.go +11 -0
  766. package/govendor/golang.org/x/sys/cpu/cpu_other_x86.go +11 -0
  767. package/govendor/golang.org/x/sys/cpu/cpu_ppc64x.go +16 -0
  768. package/govendor/golang.org/x/sys/cpu/cpu_riscv64.go +33 -0
  769. package/govendor/golang.org/x/sys/cpu/cpu_riscv64.s +17 -0
  770. package/govendor/golang.org/x/sys/cpu/cpu_s390x.go +172 -0
  771. package/govendor/golang.org/x/sys/cpu/cpu_s390x.s +57 -0
  772. package/govendor/golang.org/x/sys/cpu/cpu_sparc64.go +12 -0
  773. package/govendor/golang.org/x/sys/cpu/cpu_wasm.go +17 -0
  774. package/govendor/golang.org/x/sys/cpu/cpu_windows.go +26 -0
  775. package/govendor/golang.org/x/sys/cpu/cpu_windows_arm64.go +38 -0
  776. package/govendor/golang.org/x/sys/cpu/cpu_x86.go +259 -0
  777. package/govendor/golang.org/x/sys/cpu/cpu_zos.go +10 -0
  778. package/govendor/golang.org/x/sys/cpu/cpu_zos_s390x.go +25 -0
  779. package/govendor/golang.org/x/sys/cpu/endian_big.go +10 -0
  780. package/govendor/golang.org/x/sys/cpu/endian_little.go +10 -0
  781. package/govendor/golang.org/x/sys/cpu/hwcap_linux.go +71 -0
  782. package/govendor/golang.org/x/sys/cpu/parse.go +55 -0
  783. package/govendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go +53 -0
  784. package/govendor/golang.org/x/sys/cpu/runtime_auxv.go +16 -0
  785. package/govendor/golang.org/x/sys/cpu/runtime_auxv_go121.go +18 -0
  786. package/govendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go +26 -0
  787. package/govendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go +35 -0
  788. package/govendor/golang.org/x/sys/cpu/syscall_darwin_arm64_gc.go +54 -0
  789. package/govendor/golang.org/x/sys/cpu/syscall_darwin_x86_gc.go +98 -0
  790. package/govendor/golang.org/x/sys/cpu/zcpu_windows.go +48 -0
  791. package/govendor/golang.org/x/sys/unix/asm_linux_ppc64x.s +20 -0
  792. package/govendor/golang.org/x/sys/unix/asm_linux_sparc64.s +48 -0
  793. package/govendor/golang.org/x/sys/unix/asm_zos_s390x.s +4 -186
  794. package/govendor/golang.org/x/sys/unix/bpxsvc_zos.s +9 -9
  795. package/govendor/golang.org/x/sys/unix/fcntl_darwin.go +2 -2
  796. package/govendor/golang.org/x/sys/unix/mkerrors.sh +1 -1
  797. package/govendor/golang.org/x/sys/unix/ptrace_zos.go +537 -0
  798. package/govendor/golang.org/x/sys/unix/ptrace_zos_singlestep.go +425 -0
  799. package/govendor/golang.org/x/sys/unix/syscall_darwin.go +1 -0
  800. package/govendor/golang.org/x/sys/unix/syscall_freebsd.go +9 -0
  801. package/govendor/golang.org/x/sys/unix/syscall_linux.go +20 -1
  802. package/govendor/golang.org/x/sys/unix/syscall_linux_sparc64.go +3 -3
  803. package/govendor/golang.org/x/sys/unix/syscall_netbsd.go +9 -0
  804. package/govendor/golang.org/x/sys/unix/syscall_unix_gc.go +1 -1
  805. package/govendor/golang.org/x/sys/unix/syscall_zos_s390x.go +0 -4
  806. package/govendor/golang.org/x/sys/unix/xattr_bsd.go +12 -12
  807. package/govendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go +6 -0
  808. package/govendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go +6 -0
  809. package/govendor/golang.org/x/sys/unix/zerrors_linux.go +32 -0
  810. package/govendor/golang.org/x/sys/unix/zerrors_linux_386.go +2 -0
  811. package/govendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +2 -0
  812. package/govendor/golang.org/x/sys/unix/zerrors_linux_arm.go +2 -0
  813. package/govendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +2 -0
  814. package/govendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +2 -0
  815. package/govendor/golang.org/x/sys/unix/zerrors_linux_mips.go +2 -0
  816. package/govendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +2 -0
  817. package/govendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +2 -0
  818. package/govendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +2 -0
  819. package/govendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +2 -0
  820. package/govendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +2 -0
  821. package/govendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +2 -0
  822. package/govendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +2 -0
  823. package/govendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +2 -0
  824. package/govendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +2 -0
  825. package/govendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +11 -0
  826. package/govendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +11 -0
  827. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go +159 -0
  828. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go +159 -0
  829. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go +159 -0
  830. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go +159 -0
  831. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go +159 -0
  832. package/govendor/golang.org/x/sys/unix/zsyscall_linux.go +28 -1
  833. package/govendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go +3 -3
  834. package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go +159 -0
  835. package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go +159 -0
  836. package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go +159 -0
  837. package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go +159 -0
  838. package/govendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go +13 -0
  839. package/govendor/golang.org/x/sys/unix/ztypes_linux.go +65 -36
  840. package/govendor/golang.org/x/sys/unix/ztypes_linux_386.go +6 -0
  841. package/govendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +7 -0
  842. package/govendor/golang.org/x/sys/unix/ztypes_linux_arm.go +6 -0
  843. package/govendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +7 -0
  844. package/govendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +7 -0
  845. package/govendor/golang.org/x/sys/unix/ztypes_linux_mips.go +6 -0
  846. package/govendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +7 -0
  847. package/govendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +7 -0
  848. package/govendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +6 -0
  849. package/govendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +6 -0
  850. package/govendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +7 -0
  851. package/govendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +7 -0
  852. package/govendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +7 -0
  853. package/govendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +7 -0
  854. package/govendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +10 -5
  855. package/govendor/golang.org/x/sys/unix/ztypes_zos_s390x.go +78 -0
  856. package/govendor/golang.org/x/text/.gitattributes +10 -0
  857. package/govendor/golang.org/x/text/CONTRIBUTING.md +26 -0
  858. package/govendor/golang.org/x/text/LICENSE +27 -0
  859. package/govendor/golang.org/x/text/PATENTS +22 -0
  860. package/govendor/golang.org/x/text/README.md +81 -0
  861. package/govendor/golang.org/x/text/cases/cases.go +162 -0
  862. package/govendor/golang.org/x/text/cases/context.go +376 -0
  863. package/govendor/golang.org/x/text/cases/fold.go +34 -0
  864. package/govendor/golang.org/x/text/cases/icu.go +61 -0
  865. package/govendor/golang.org/x/text/cases/info.go +82 -0
  866. package/govendor/golang.org/x/text/cases/map.go +816 -0
  867. package/govendor/golang.org/x/text/cases/tables15.0.0.go +2527 -0
  868. package/govendor/golang.org/x/text/cases/tables17.0.0.go +2642 -0
  869. package/govendor/golang.org/x/text/cases/trieval.go +217 -0
  870. package/govendor/golang.org/x/text/codereview.cfg +1 -0
  871. package/govendor/golang.org/x/text/collate/collate.go +402 -0
  872. package/govendor/golang.org/x/text/collate/index.go +32 -0
  873. package/govendor/golang.org/x/text/collate/option.go +239 -0
  874. package/govendor/golang.org/x/text/collate/sort.go +81 -0
  875. package/govendor/golang.org/x/text/collate/tables.go +73789 -0
  876. package/govendor/golang.org/x/text/currency/common.go +67 -0
  877. package/govendor/golang.org/x/text/currency/currency.go +185 -0
  878. package/govendor/golang.org/x/text/currency/format.go +220 -0
  879. package/govendor/golang.org/x/text/currency/query.go +152 -0
  880. package/govendor/golang.org/x/text/currency/tables.go +2629 -0
  881. package/govendor/golang.org/x/text/doc.go +16 -0
  882. package/govendor/golang.org/x/text/feature/plural/common.go +70 -0
  883. package/govendor/golang.org/x/text/feature/plural/message.go +244 -0
  884. package/govendor/golang.org/x/text/feature/plural/plural.go +262 -0
  885. package/govendor/golang.org/x/text/feature/plural/tables.go +552 -0
  886. package/govendor/golang.org/x/text/go.mod +3 -0
  887. package/govendor/golang.org/x/text/internal/catmsg/catmsg.go +417 -0
  888. package/govendor/golang.org/x/text/internal/catmsg/codec.go +407 -0
  889. package/govendor/golang.org/x/text/internal/catmsg/varint.go +62 -0
  890. package/govendor/golang.org/x/text/internal/colltab/collelem.go +374 -0
  891. package/govendor/golang.org/x/text/internal/colltab/colltab.go +105 -0
  892. package/govendor/golang.org/x/text/internal/colltab/contract.go +145 -0
  893. package/govendor/golang.org/x/text/internal/colltab/iter.go +178 -0
  894. package/govendor/golang.org/x/text/internal/colltab/numeric.go +236 -0
  895. package/govendor/golang.org/x/text/internal/colltab/table.go +275 -0
  896. package/govendor/golang.org/x/text/internal/colltab/trie.go +159 -0
  897. package/govendor/golang.org/x/text/internal/colltab/weighter.go +31 -0
  898. package/govendor/golang.org/x/text/internal/format/format.go +41 -0
  899. package/govendor/golang.org/x/text/internal/format/parser.go +358 -0
  900. package/govendor/golang.org/x/text/internal/internal.go +49 -0
  901. package/govendor/golang.org/x/text/internal/language/common.go +16 -0
  902. package/govendor/golang.org/x/text/internal/language/compact/compact.go +61 -0
  903. package/govendor/golang.org/x/text/internal/language/compact/language.go +260 -0
  904. package/govendor/golang.org/x/text/internal/language/compact/parents.go +120 -0
  905. package/govendor/golang.org/x/text/internal/language/compact/tables.go +1015 -0
  906. package/govendor/golang.org/x/text/internal/language/compact/tags.go +91 -0
  907. package/govendor/golang.org/x/text/internal/language/compact.go +29 -0
  908. package/govendor/golang.org/x/text/internal/language/compose.go +167 -0
  909. package/govendor/golang.org/x/text/internal/language/coverage.go +28 -0
  910. package/govendor/golang.org/x/text/internal/language/language.go +627 -0
  911. package/govendor/golang.org/x/text/internal/language/lookup.go +412 -0
  912. package/govendor/golang.org/x/text/internal/language/match.go +226 -0
  913. package/govendor/golang.org/x/text/internal/language/parse.go +608 -0
  914. package/govendor/golang.org/x/text/internal/language/tables.go +3494 -0
  915. package/govendor/golang.org/x/text/internal/language/tags.go +48 -0
  916. package/govendor/golang.org/x/text/internal/match.go +67 -0
  917. package/govendor/golang.org/x/text/internal/number/common.go +55 -0
  918. package/govendor/golang.org/x/text/internal/number/decimal.go +500 -0
  919. package/govendor/golang.org/x/text/internal/number/format.go +533 -0
  920. package/govendor/golang.org/x/text/internal/number/number.go +152 -0
  921. package/govendor/golang.org/x/text/internal/number/pattern.go +485 -0
  922. package/govendor/golang.org/x/text/internal/number/roundingmode_string.go +30 -0
  923. package/govendor/golang.org/x/text/internal/number/tables.go +1219 -0
  924. package/govendor/golang.org/x/text/internal/stringset/set.go +86 -0
  925. package/govendor/golang.org/x/text/internal/tag/tag.go +100 -0
  926. package/govendor/golang.org/x/text/language/coverage.go +187 -0
  927. package/govendor/golang.org/x/text/language/display/dict.go +92 -0
  928. package/govendor/golang.org/x/text/language/display/display.go +420 -0
  929. package/govendor/golang.org/x/text/language/display/lookup.go +253 -0
  930. package/govendor/golang.org/x/text/language/display/tables.go +53114 -0
  931. package/govendor/golang.org/x/text/language/doc.go +98 -0
  932. package/govendor/golang.org/x/text/language/language.go +605 -0
  933. package/govendor/golang.org/x/text/language/match.go +735 -0
  934. package/govendor/golang.org/x/text/language/parse.go +258 -0
  935. package/govendor/golang.org/x/text/language/tables.go +298 -0
  936. package/govendor/golang.org/x/text/language/tags.go +145 -0
  937. package/govendor/golang.org/x/text/message/catalog/catalog.go +365 -0
  938. package/govendor/golang.org/x/text/message/catalog/dict.go +133 -0
  939. package/govendor/golang.org/x/text/secure/bidirule/bidirule.go +346 -0
  940. package/govendor/golang.org/x/text/transform/transform.go +709 -0
  941. package/govendor/golang.org/x/text/unicode/bidi/bidi.go +359 -0
  942. package/govendor/golang.org/x/text/unicode/bidi/bracket.go +335 -0
  943. package/govendor/golang.org/x/text/unicode/bidi/core.go +1050 -0
  944. package/govendor/golang.org/x/text/unicode/bidi/prop.go +206 -0
  945. package/govendor/golang.org/x/text/unicode/bidi/tables15.0.0.go +2042 -0
  946. package/govendor/golang.org/x/text/unicode/bidi/tables17.0.0.go +2135 -0
  947. package/govendor/golang.org/x/text/unicode/bidi/trieval.go +48 -0
  948. package/govendor/golang.org/x/text/unicode/norm/composition.go +524 -0
  949. package/govendor/golang.org/x/text/unicode/norm/forminfo.go +296 -0
  950. package/govendor/golang.org/x/text/unicode/norm/input.go +109 -0
  951. package/govendor/golang.org/x/text/unicode/norm/iter.go +454 -0
  952. package/govendor/golang.org/x/text/unicode/norm/normalize.go +613 -0
  953. package/govendor/golang.org/x/text/unicode/norm/readwriter.go +125 -0
  954. package/govendor/golang.org/x/text/unicode/norm/tables15.0.0.go +7907 -0
  955. package/govendor/golang.org/x/text/unicode/norm/tables17.0.0.go +8104 -0
  956. package/govendor/golang.org/x/text/unicode/norm/transform.go +89 -0
  957. package/govendor/golang.org/x/text/unicode/norm/trie.go +54 -0
  958. package/govendor/manifest.txt +11 -2
  959. package/govendor/software.sslmate.com/src/go-pkcs12/.gitattributes +10 -0
  960. package/govendor/software.sslmate.com/src/go-pkcs12/LICENSE +28 -0
  961. package/govendor/software.sslmate.com/src/go-pkcs12/README.md +31 -0
  962. package/govendor/software.sslmate.com/src/go-pkcs12/bmp-string.go +63 -0
  963. package/govendor/software.sslmate.com/src/go-pkcs12/crypto.go +331 -0
  964. package/govendor/software.sslmate.com/src/go-pkcs12/errors.go +23 -0
  965. package/govendor/software.sslmate.com/src/go-pkcs12/go.mod +3 -0
  966. package/govendor/software.sslmate.com/src/go-pkcs12/internal/rc2/rc2.go +271 -0
  967. package/govendor/software.sslmate.com/src/go-pkcs12/mac.go +202 -0
  968. package/govendor/software.sslmate.com/src/go-pkcs12/pbkdf.go +184 -0
  969. package/govendor/software.sslmate.com/src/go-pkcs12/pkcs12.go +1000 -0
  970. package/govendor/software.sslmate.com/src/go-pkcs12/safebags.go +107 -0
  971. package/package.json +11 -1
  972. package/types/tsconfig.json +17 -0
  973. package/types/typenative-npm.d.ts +1327 -80
  974. package/types/typenative.d.ts +1312 -25
  975. package/.gitattributes +0 -1
  976. package/.github/workflows/ci.yml +0 -68
  977. package/.github/workflows/npm-publish-github-packages.yml +0 -88
  978. package/CHANGELOG.md +0 -1358
  979. package/CONTRIBUTION.md +0 -133
  980. package/conformance.md +0 -1450
  981. package/examples/README.md +0 -113
  982. package/examples/angular-templates/README.md +0 -141
  983. package/examples/angular-templates/bench.mjs +0 -173
  984. package/examples/angular-templates/dom-type-globals.d.ts +0 -21
  985. package/examples/angular-templates/dom-type-stubs.ts +0 -21
  986. package/examples/angular-templates/main.ts +0 -135
  987. package/examples/angular-templates/parity.mjs +0 -157
  988. package/examples/angular-templates/run-node.mjs +0 -69
  989. package/examples/angular-templates/vendor/angular/compiler/LICENSE +0 -21
  990. package/examples/desktop-notes/README.md +0 -106
  991. package/examples/desktop-notes/bench.mjs +0 -125
  992. package/examples/desktop-notes/main.ts +0 -131
  993. package/examples/desktop-notes/package-lock.json +0 -726
  994. package/examples/desktop-notes/package.json +0 -9
  995. package/examples/desktop-notes/ui.ts +0 -176
  996. package/examples/dupe-finder/README.md +0 -78
  997. package/examples/dupe-finder/bench.mjs +0 -120
  998. package/examples/dupe-finder/main.ts +0 -87
  999. package/examples/fibonacci/README.md +0 -89
  1000. package/examples/fibonacci/bench.mjs +0 -87
  1001. package/examples/fibonacci/main.ts +0 -21
  1002. package/examples/hello-world/README.md +0 -62
  1003. package/examples/hello-world/bench.mjs +0 -66
  1004. package/examples/hello-world/main.ts +0 -7
  1005. package/examples/json-server/README.md +0 -131
  1006. package/examples/json-server/bench.mjs +0 -263
  1007. package/examples/json-server/main.ts +0 -67
  1008. package/examples/mandelbrot-png/README.md +0 -63
  1009. package/examples/mandelbrot-png/bench.mjs +0 -95
  1010. package/examples/mandelbrot-png/main.ts +0 -98
  1011. package/examples/mandelbrot-png/preview.png +0 -0
  1012. package/examples/marked-cli/README.md +0 -175
  1013. package/examples/marked-cli/bench.mjs +0 -178
  1014. package/examples/marked-cli/main.ts +0 -410
  1015. package/examples/marked-cli/parity.mjs +0 -185
  1016. package/examples/marked-cli/vendor/marked/LICENSE +0 -44
  1017. package/examples/marked-cli/vendor/marked/VENDOR.md +0 -26
  1018. package/examples/openai-chat/README.md +0 -148
  1019. package/examples/openai-chat/bench.mjs +0 -175
  1020. package/examples/openai-chat/main.ts +0 -488
  1021. package/examples/react-compiler/README.md +0 -185
  1022. package/examples/react-compiler/bench.mjs +0 -181
  1023. package/examples/react-compiler/main.ts +0 -324
  1024. package/examples/react-compiler/parity.mjs +0 -362
  1025. package/examples/react-compiler/run-node.mjs +0 -90
  1026. package/examples/react-compiler/vendor/babel/LICENSE +0 -22
  1027. package/examples/react-compiler/vendor/babel/helper-globals/data/builtin-lower.json +0 -15
  1028. package/examples/react-compiler/vendor/babel/helper-globals/data/builtin-upper.json +0 -51
  1029. package/examples/react-compiler/vendor/charcodes/package.json +0 -25
  1030. package/examples/react-compiler/vendor/invariant/LICENSE +0 -21
  1031. package/examples/react-compiler/vendor/invariant/invariant.cjs +0 -51
  1032. package/examples/react-compiler/vendor/invariant/invariant.d.cts +0 -11
  1033. package/examples/react-compiler/vendor/invariant/types/LICENSE +0 -21
  1034. package/examples/react-compiler/vendor/jridgewell/gen-mapping/LICENSE +0 -19
  1035. package/examples/react-compiler/vendor/jridgewell/resolve-uri/LICENSE +0 -19
  1036. package/examples/react-compiler/vendor/jridgewell/sourcemap-codec/LICENSE +0 -19
  1037. package/examples/react-compiler/vendor/jridgewell/trace-mapping/LICENSE +0 -19
  1038. package/examples/react-compiler/vendor/js-tokens/LICENSE +0 -21
  1039. package/examples/react-compiler/vendor/js-tokens/index.cjs +0 -23
  1040. package/examples/react-compiler/vendor/js-tokens/index.d.cts +0 -13
  1041. package/examples/react-compiler/vendor/jsesc/jsesc.cjs +0 -337
  1042. package/examples/react-compiler/vendor/jsesc/jsesc.d.cts +0 -384
  1043. package/examples/react-compiler/vendor/jsesc/types/LICENSE +0 -21
  1044. package/examples/react-compiler/vendor/picocolors/picocolors.cjs +0 -75
  1045. package/examples/react-compiler/vendor/picocolors/picocolors.d.cts +0 -5
  1046. package/examples/react-compiler/vendor/picocolors/types.d.ts +0 -51
  1047. package/examples/react-compiler/vendor/react-compiler/LICENSE +0 -21
  1048. package/examples/react-compiler/vendor/stubs/babel-core.ts +0 -31
  1049. package/examples/react-compiler/vendor/stubs/debug.ts +0 -18
  1050. package/examples/react-compiler/vendor/stubs/js-tokens.d.ts +0 -13
  1051. package/examples/react-compiler/vendor/stubs/pretty-format.ts +0 -18
  1052. package/examples/react-compiler/vendor/zod/LICENSE +0 -21
  1053. package/examples/react-compiler/vendor/zod-validation-error/LICENSE +0 -9
  1054. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/NonEmptyArray.ts +0 -5
  1055. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/joinPath.ts +0 -49
  1056. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/joinValues.ts +0 -48
  1057. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/stringify.ts +0 -50
  1058. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/titleCase.ts +0 -6
  1059. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/MessageBuilder.ts +0 -126
  1060. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/ValidationError.ts +0 -39
  1061. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/custom.ts +0 -12
  1062. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/errorMap.ts +0 -78
  1063. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/index.ts +0 -2
  1064. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidElement.ts +0 -12
  1065. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidKey.ts +0 -12
  1066. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidStringFormat.ts +0 -131
  1067. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidType.ts +0 -54
  1068. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidUnion.ts +0 -12
  1069. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidValue.ts +0 -40
  1070. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/notMultipleOf.ts +0 -12
  1071. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/tooBig.ts +0 -76
  1072. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/tooSmall.ts +0 -76
  1073. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/types.ts +0 -27
  1074. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/unrecognizedKeys.ts +0 -27
  1075. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/fromError.ts +0 -13
  1076. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/fromZodError.ts +0 -61
  1077. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/fromZodIssue.ts +0 -38
  1078. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/index.ts +0 -20
  1079. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/isValidationError.ts +0 -5
  1080. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/isValidationErrorLike.ts +0 -8
  1081. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/isZodErrorLike.ts +0 -11
  1082. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/toValidationError.ts +0 -20
  1083. package/examples/react-compiler/vendor.mjs +0 -688
  1084. package/examples/todo-cli/README.md +0 -69
  1085. package/examples/todo-cli/bench.mjs +0 -89
  1086. package/examples/todo-cli/main.ts +0 -92
  1087. package/examples/yaml-cli/README.md +0 -152
  1088. package/examples/yaml-cli/bench.mjs +0 -265
  1089. package/examples/yaml-cli/main.ts +0 -251
  1090. package/examples/yaml-cli/parity.mjs +0 -156
  1091. package/examples/yaml-cli/vendor/yaml/LICENSE +0 -13
  1092. package/examples/yaml-cli/vendor/yaml/VENDOR.md +0 -25
  1093. package/govendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go +0 -22
  1094. package/govendor/golang.org/x/sys/windows/types_windows_arm.go +0 -35
  1095. package/performance/README.md +0 -196
  1096. package/performance/any-dynamic.ts +0 -21
  1097. package/performance/any-record-view.ts +0 -20
  1098. package/performance/arr-hof.ts +0 -21
  1099. package/performance/arr-push-index.ts +0 -15
  1100. package/performance/arr-sort.ts +0 -21
  1101. package/performance/async-await.ts +0 -24
  1102. package/performance/class-dispatch.ts +0 -52
  1103. package/performance/events-emit.ts +0 -27
  1104. package/performance/exc-throw-rare.ts +0 -25
  1105. package/performance/exc-try-catch.ts +0 -26
  1106. package/performance/fn-closures.ts +0 -29
  1107. package/performance/fn-recursion-tree.ts +0 -31
  1108. package/performance/gen-for-of.ts +0 -46
  1109. package/performance/json-roundtrip.ts +0 -27
  1110. package/performance/map-delete.ts +0 -24
  1111. package/performance/map-string-keys.ts +0 -22
  1112. package/performance/num-arith-loop.ts +0 -14
  1113. package/performance/num-bitwise.ts +0 -21
  1114. package/performance/num-mod-int.ts +0 -16
  1115. package/performance/num-to-string.ts +0 -16
  1116. package/performance/obj-alloc.ts +0 -32
  1117. package/performance/regex-exec.ts +0 -29
  1118. package/performance/regex-site.ts +0 -28
  1119. package/performance/set-ops.ts +0 -20
  1120. package/performance/str-char-scan.ts +0 -35
  1121. package/performance/str-concat-plus.ts +0 -18
  1122. package/performance/str-concat.ts +0 -24
  1123. package/performance/str-short-scan.ts +0 -26
  1124. package/performance/str-split-join.ts +0 -23
  1125. package/performance/str-template.ts +0 -16
  1126. package/performance/union-switch.ts +0 -57
  1127. package/tsparser/check.go +0 -158
  1128. package/tsparser/go.mod +0 -14
  1129. package/tsparser/go.sum +0 -22
  1130. package/tsparser/main.go +0 -363
  1131. package/tsparser/tsparser.exe +0 -4
package/bin/node/fs.js CHANGED
@@ -78,6 +78,7 @@ func tnFsCheck(err error, syscall string, path string, dest ...string) {
78
78
  }`;
79
79
  const fsHelper = `// node:fs (sync)
80
80
  func TnReadFileBytes(path string) []byte {
81
+ tnPermRequire("fs.read", path)
81
82
  data, err := os.ReadFile(path)
82
83
  if err != nil {
83
84
  if tnErrnoCode(err) == "EISDIR" {
@@ -128,6 +129,7 @@ func tnOpenFlags(flag string) int {
128
129
  }
129
130
 
130
131
  func TnWriteFile(path string, data []byte, flag string) {
132
+ tnPermRequire("fs.write", path)
131
133
  if flag == "" {
132
134
  flag = "w"
133
135
  }
@@ -139,6 +141,7 @@ func TnWriteFile(path string, data []byte, flag string) {
139
141
  }
140
142
 
141
143
  func TnMkdir(path string, recursive bool) {
144
+ tnPermRequire("fs.write", path)
142
145
  if recursive {
143
146
  if info, err := os.Stat(path); err == nil && !info.IsDir() {
144
147
  panic(TnSysError(fs.ErrExist, "mkdir", path))
@@ -165,6 +168,7 @@ func (d *TnDirent) isBlockDevice() bool { return d.mode&fs.ModeDevice != 0 &&
165
168
  func (d *TnDirent) isCharacterDevice() bool { return d.mode&fs.ModeCharDevice != 0 }
166
169
 
167
170
  func tnReadDirEntries(dir string, recursive bool) []*TnDirent {
171
+ tnPermRequire("fs.read", dir)
168
172
  entries, err := os.ReadDir(dir)
169
173
  tnFsCheck(err, "scandir", dir)
170
174
  out := []*TnDirent{}
@@ -183,6 +187,29 @@ func TnReadDirents(dir string, recursive bool) []*TnDirent {
183
187
  return tnReadDirEntries(dir, recursive)
184
188
  }
185
189
 
190
+ // readFileSync(path, { buffer }): the file read into the given buffer (its
191
+ // leading bytes, a view of the same memory)
192
+ func TnReadFileInto(path string, options interface{}) []byte {
193
+ buf, _ := TnGetValue(options, "buffer").([]byte)
194
+ data := TnReadFileBytes(path)
195
+ if len(buf) < len(data) {
196
+ panic(TnNodeError("TypeError", "ERR_INVALID_ARG_VALUE", "The property 'options.buffer.byteLength' is smaller than the file size of "+strconv.Itoa(len(data))+" bytes. Received "+strconv.Itoa(len(buf))))
197
+ }
198
+ n := copy(buf, data)
199
+ return buf[:n]
200
+ }
201
+
202
+ // An options object's AbortSignal, already aborted: its reason is thrown
203
+ func TnFsCheckSignal(options interface{}) {
204
+ if options == nil {
205
+ return
206
+ }
207
+ signal := TnGetValue(options, "signal")
208
+ if signal != nil && TnTruthy(TnGetValue(signal, "aborted")) {
209
+ panic(TnGetValue(signal, "reason"))
210
+ }
211
+ }
212
+
186
213
  // readdirSync names; recursive names are relative to dir
187
214
  func TnReadDirNames(dir string, recursive bool) []string {
188
215
  names := []string{}
@@ -271,6 +298,7 @@ func tnStatsOf(info fs.FileInfo) *TnStats {
271
298
  }
272
299
 
273
300
  func TnStat(path string, lstat bool, throwIfNoEntry bool) *TnStats {
301
+ tnPermRequire("fs.read", path)
274
302
  var info fs.FileInfo
275
303
  var err error
276
304
  syscall := "stat"
@@ -290,16 +318,20 @@ func TnStat(path string, lstat bool, throwIfNoEntry bool) *TnStats {
290
318
  }
291
319
 
292
320
  func TnExists(path string) bool {
321
+ tnPermRequire("fs.read", path)
293
322
  _, err := os.Stat(path)
294
323
  return err == nil
295
324
  }
296
325
 
297
326
  func TnRename(from string, to string) {
327
+ tnPermRequire("fs.write", from)
328
+ tnPermRequire("fs.write", to)
298
329
  tnFsCheck(os.Rename(from, to), "rename", from, to)
299
330
  }
300
331
 
301
332
  // rmSync(path, { recursive, force })
302
333
  func TnRm(path string, recursive bool, force bool) {
334
+ tnPermRequire("fs.write", path)
303
335
  info, err := os.Lstat(path)
304
336
  if err != nil {
305
337
  if force && tnErrnoCode(err) == "ENOENT" {
@@ -318,6 +350,7 @@ func TnRm(path string, recursive bool, force bool) {
318
350
  }
319
351
 
320
352
  func TnRmdir(path string, recursive bool) {
353
+ tnPermRequire("fs.write", path)
321
354
  if recursive {
322
355
  tnFsCheck(os.RemoveAll(path), "rmdir", path)
323
356
  return
@@ -331,6 +364,7 @@ func TnRmdir(path string, recursive bool) {
331
364
  }
332
365
 
333
366
  func TnUnlink(path string) {
367
+ tnPermRequire("fs.write", path)
334
368
  info, err := os.Lstat(path)
335
369
  tnFsCheck(err, "unlink", path)
336
370
  if info.IsDir() {
@@ -341,6 +375,8 @@ func TnUnlink(path string) {
341
375
 
342
376
  // copyFileSync(src, dest, mode): mode 1 (COPYFILE_EXCL) fails if dest exists
343
377
  func TnCopyFile(src string, dst string, mode float64) {
378
+ tnPermRequire("fs.read", src)
379
+ tnPermRequire("fs.write", dst)
344
380
  in, err := os.Open(src)
345
381
  tnFsCheck(err, "copyfile", src, dst)
346
382
  defer in.Close()
@@ -362,6 +398,8 @@ func TnCopyFile(src string, dst string, mode float64) {
362
398
 
363
399
  // cpSync(src, dest, { recursive, force, errorOnExist })
364
400
  func TnCp(src string, dst string, recursive bool, force bool) {
401
+ tnPermRequire("fs.read", src)
402
+ tnPermRequire("fs.write", dst)
365
403
  info, err := os.Stat(src)
366
404
  tnFsCheck(err, "cp", src)
367
405
  if info.IsDir() {
@@ -385,6 +423,7 @@ func TnCp(src string, dst string, recursive bool, force bool) {
385
423
  }
386
424
 
387
425
  func TnRealpath(path string) string {
426
+ tnPermRequire("fs.read", path)
388
427
  abs, err := filepath.Abs(path)
389
428
  tnFsCheck(err, "realpath", path)
390
429
  real, err := filepath.EvalSymlinks(abs)
@@ -393,6 +432,7 @@ func TnRealpath(path string) string {
393
432
  }
394
433
 
395
434
  func TnMkdtemp(prefix string) string {
435
+ tnPermRequire("fs.write", prefix)
396
436
  dir, base := filepath.Split(prefix)
397
437
  if dir == "" {
398
438
  dir = "."
@@ -403,6 +443,7 @@ func TnMkdtemp(prefix string) string {
403
443
  }
404
444
 
405
445
  func TnTruncate(path string, length float64) {
446
+ tnPermRequire("fs.write", path)
406
447
  tnFsCheck(os.Truncate(path, int64(length)), "open", path)
407
448
  }
408
449
 
@@ -418,6 +459,7 @@ func tnFileMode(mode interface{}) fs.FileMode {
418
459
  }
419
460
 
420
461
  func TnChmod(path string, mode interface{}) {
462
+ tnPermRequire("fs.write", path)
421
463
  tnFsCheck(os.Chmod(path, tnFileMode(mode)), "chmod", path)
422
464
  }
423
465
 
@@ -435,25 +477,33 @@ func tnTimeArg(v interface{}) time.Time {
435
477
  }
436
478
 
437
479
  func TnUtimes(path string, atime interface{}, mtime interface{}) {
480
+ tnPermRequire("fs.write", path)
438
481
  tnFsCheck(os.Chtimes(path, tnTimeArg(atime), tnTimeArg(mtime)), "utime", path)
439
482
  }
440
483
 
441
484
  func TnSymlink(target string, path string) {
485
+ // (Node needs full read and write access for symlinks)
486
+ tnPermRequire("fs.read", "")
487
+ tnPermRequire("fs.write", "")
442
488
  tnFsCheck(os.Symlink(target, path), "symlink", target, path)
443
489
  }
444
490
 
445
491
  func TnReadlink(path string) string {
492
+ tnPermRequire("fs.read", path)
446
493
  target, err := os.Readlink(path)
447
494
  tnFsCheck(err, "readlink", path)
448
495
  return target
449
496
  }
450
497
 
451
498
  func TnLink(existing string, path string) {
499
+ tnPermRequire("fs.read", existing)
500
+ tnPermRequire("fs.write", path)
452
501
  tnFsCheck(os.Link(existing, path), "link", existing, path)
453
502
  }
454
503
 
455
504
  // accessSync(path, mode): F_OK 0, R_OK 4, W_OK 2, X_OK 1
456
505
  func TnAccess(path string, mode float64) {
506
+ tnPermRequire("fs.read", path)
457
507
  info, err := os.Stat(path)
458
508
  tnFsCheck(err, "access", path)
459
509
  perm := info.Mode().Perm()
@@ -497,6 +547,15 @@ func TnOpen(path string, flags interface{}, mode ...interface{}) float64 {
497
547
  if s, ok := flags.(string); ok && s != "" {
498
548
  flag = s
499
549
  }
550
+ // --permission: reads and writes through open() are gated separately
551
+ if flag == "r" || flag == "rs" {
552
+ tnPermRequire("fs.read", path)
553
+ } else {
554
+ tnPermRequire("fs.write", path)
555
+ if strings.Contains(flag, "+") {
556
+ tnPermRequire("fs.read", path)
557
+ }
558
+ }
500
559
  perm := fs.FileMode(0o666)
501
560
  if len(mode) > 0 && mode[0] != nil {
502
561
  perm = tnFileMode(mode[0])
@@ -646,6 +705,223 @@ export function readResultType(call, index) {
646
705
  return encodingOf(node) ? 'string' : '[]byte';
647
706
  return call.types[index] === 'string' ? 'string' : '[]byte';
648
707
  }
708
+ const statfsHelper = `// fs.statfs: the file system holding path
709
+ type TnStatFs struct {
710
+ type_ float64
711
+ bsize float64
712
+ frsize float64
713
+ blocks float64
714
+ bfree float64
715
+ bavail float64
716
+ files float64
717
+ ffree float64
718
+ }
719
+
720
+ func (s *TnStatFs) Get_type_() float64 { return s.type_ }
721
+
722
+ func TnStatfs(path string) *TnStatFs {
723
+ tnPermRequire("fs.read", path)
724
+ s, err := tnStatfsOS(path)
725
+ tnFsCheck(err, "statfs", path)
726
+ return s
727
+ }`;
728
+ const statfsOSHelpers = {
729
+ linux: `func tnStatfsOS(path string) (*TnStatFs, error) {
730
+ var st syscall.Statfs_t
731
+ if err := syscall.Statfs(path, &st); err != nil {
732
+ return nil, err
733
+ }
734
+ return &TnStatFs{type_: float64(st.Type), bsize: float64(st.Bsize), frsize: float64(st.Frsize), blocks: float64(st.Blocks), bfree: float64(st.Bfree), bavail: float64(st.Bavail), files: float64(st.Files), ffree: float64(st.Ffree)}, nil
735
+ }`,
736
+ bsd: `func tnStatfsOS(path string) (*TnStatFs, error) {
737
+ var st syscall.Statfs_t
738
+ if err := syscall.Statfs(path, &st); err != nil {
739
+ return nil, err
740
+ }
741
+ return &TnStatFs{type_: float64(st.Type), bsize: float64(st.Bsize), frsize: float64(st.Bsize), blocks: float64(st.Blocks), bfree: float64(st.Bfree), bavail: float64(st.Bavail), files: float64(st.Files), ffree: float64(st.Ffree)}, nil
742
+ }`,
743
+ windows: `func tnStatfsOS(path string) (*TnStatFs, error) {
744
+ abs, err := filepath.Abs(path)
745
+ if err != nil {
746
+ return nil, err
747
+ }
748
+ if _, err := os.Stat(abs); err != nil {
749
+ return nil, err
750
+ }
751
+ root := filepath.VolumeName(abs) + "\\\\"
752
+ p, err := syscall.UTF16PtrFromString(root)
753
+ if err != nil {
754
+ return nil, err
755
+ }
756
+ var sectorsPerCluster, bytesPerSector, freeClusters, totalClusters uint32
757
+ proc := syscall.NewLazyDLL("kernel32.dll").NewProc("GetDiskFreeSpaceW")
758
+ r, _, callErr := proc.Call(uintptr(unsafe.Pointer(p)), uintptr(unsafe.Pointer(&sectorsPerCluster)), uintptr(unsafe.Pointer(&bytesPerSector)), uintptr(unsafe.Pointer(&freeClusters)), uintptr(unsafe.Pointer(&totalClusters)))
759
+ if r == 0 {
760
+ return nil, callErr
761
+ }
762
+ var freeToCaller, total, free uint64
763
+ procEx := syscall.NewLazyDLL("kernel32.dll").NewProc("GetDiskFreeSpaceExW")
764
+ procEx.Call(uintptr(unsafe.Pointer(p)), uintptr(unsafe.Pointer(&freeToCaller)), uintptr(unsafe.Pointer(&total)), uintptr(unsafe.Pointer(&free)))
765
+ bsize := uint64(sectorsPerCluster) * uint64(bytesPerSector)
766
+ if bsize == 0 {
767
+ bsize = 4096
768
+ }
769
+ return &TnStatFs{bsize: float64(bsize), frsize: float64(bsize), blocks: float64(totalClusters), bfree: float64(freeClusters), bavail: float64(freeToCaller / bsize)}, nil
770
+ }`,
771
+ other: `func tnStatfsOS(path string) (*TnStatFs, error) {
772
+ if _, err := os.Stat(path); err != nil {
773
+ return nil, err
774
+ }
775
+ return &TnStatFs{}, nil
776
+ }`
777
+ };
778
+ const globHelper = `// fs.glob: the paths under cwd matching any pattern (minimatch syntax, as
779
+ // path.matchesGlob), relative and with the platform's separators
780
+ type tnGlobMatch struct {
781
+ rel string
782
+ entry *TnDirent
783
+ }
784
+
785
+ func tnGlobPatterns(patterns interface{}) []string {
786
+ switch p := patterns.(type) {
787
+ case string:
788
+ return []string{p}
789
+ case []string:
790
+ return p
791
+ case []interface{}:
792
+ out := []string{}
793
+ for _, v := range p {
794
+ out = append(out, TnJSString(v))
795
+ }
796
+ return out
797
+ }
798
+ return nil
799
+ }
800
+
801
+ func tnGlob(patterns interface{}, options interface{}) []tnGlobMatch {
802
+ cwd := "."
803
+ maxDepth := -1
804
+ followSymlinks := false
805
+ var excludeFn interface{}
806
+ var excludeGlobs []string
807
+ if options != nil {
808
+ if c, ok := TnGetValue(options, "cwd").(string); ok && c != "" {
809
+ cwd = c
810
+ }
811
+ if d, ok := TnGetValue(options, "maxDepth").(float64); ok {
812
+ maxDepth = int(d)
813
+ }
814
+ followSymlinks = TnTruthy(TnGetValue(options, "followSymlinks"))
815
+ switch ex := TnGetValue(options, "exclude").(type) {
816
+ case nil:
817
+ case string, []string, []interface{}:
818
+ excludeGlobs = tnGlobPatterns(ex)
819
+ default:
820
+ excludeFn = ex
821
+ }
822
+ }
823
+ type compiled struct{ alts []*regexp.Regexp }
824
+ compile := func(globs []string) []compiled {
825
+ out := []compiled{}
826
+ for _, g := range globs {
827
+ g = strings.ReplaceAll(g, "\\\\", "/")
828
+ c := compiled{}
829
+ for _, alt := range tnExpandBraces(g) {
830
+ if re, err := regexp.Compile(tnGlobRegexp(alt, false)); err == nil {
831
+ c.alts = append(c.alts, re)
832
+ }
833
+ }
834
+ out = append(out, c)
835
+ }
836
+ return out
837
+ }
838
+ includes := compile(tnGlobPatterns(patterns))
839
+ excludes := compile(excludeGlobs)
840
+ matches := func(set []compiled, rel string) bool {
841
+ for _, c := range set {
842
+ for _, re := range c.alts {
843
+ if re.MatchString(rel) {
844
+ return true
845
+ }
846
+ }
847
+ }
848
+ return false
849
+ }
850
+ excluded := func(rel string, name string) bool {
851
+ if excludeFn != nil && (TnTruthy(TnInvoke(excludeFn, name)) || (rel != name && TnTruthy(TnInvoke(excludeFn, filepath.FromSlash(rel))))) {
852
+ return true
853
+ }
854
+ return matches(excludes, rel)
855
+ }
856
+ out := []tnGlobMatch{}
857
+ root, _ := filepath.Abs(cwd)
858
+ if matches(includes, ".") || matches(includes, "") {
859
+ if info, err := os.Stat(cwd); err == nil {
860
+ out = append(out, tnGlobMatch{rel: ".", entry: &TnDirent{name: filepath.Base(root), parentPath: filepath.Dir(root), path: filepath.Dir(root), mode: info.Mode().Type()}})
861
+ }
862
+ }
863
+ var walk func(dir string, relDir string, depth int)
864
+ walk = func(dir string, relDir string, depth int) {
865
+ entries, err := os.ReadDir(dir)
866
+ if err != nil {
867
+ return
868
+ }
869
+ for _, e := range entries {
870
+ rel := e.Name()
871
+ if relDir != "" {
872
+ rel = relDir + "/" + e.Name()
873
+ }
874
+ if excluded(rel, e.Name()) {
875
+ continue
876
+ }
877
+ mode := e.Type()
878
+ isDir := e.IsDir()
879
+ if mode&fs.ModeSymlink != 0 && followSymlinks {
880
+ if info, err := os.Stat(filepath.Join(dir, e.Name())); err == nil && info.IsDir() {
881
+ isDir = true
882
+ }
883
+ }
884
+ if (maxDepth < 0 || depth <= maxDepth) && matches(includes, rel) {
885
+ out = append(out, tnGlobMatch{rel: filepath.FromSlash(rel), entry: &TnDirent{name: e.Name(), parentPath: dir, path: dir, mode: mode}})
886
+ }
887
+ if isDir && (maxDepth < 0 || depth < maxDepth) {
888
+ walk(filepath.Join(dir, e.Name()), rel, depth+1)
889
+ }
890
+ }
891
+ }
892
+ walk(cwd, "", 1)
893
+ return out
894
+ }
895
+
896
+ func TnGlobSync(patterns interface{}, options ...interface{}) []string {
897
+ var opts interface{}
898
+ if len(options) > 0 {
899
+ opts = options[0]
900
+ }
901
+ out := []string{}
902
+ for _, m := range tnGlob(patterns, opts) {
903
+ out = append(out, m.rel)
904
+ }
905
+ return out
906
+ }
907
+
908
+ func TnGlobDirentsSync(patterns interface{}, options interface{}) []*TnDirent {
909
+ out := []*TnDirent{}
910
+ for _, m := range tnGlob(patterns, options) {
911
+ out = append(out, m.entry)
912
+ }
913
+ return out
914
+ }
915
+
916
+ // fs/promises glob: an async iterable of the matches
917
+ func TnGlobIter[T any](matches []T) chan T {
918
+ ch := make(chan T, len(matches))
919
+ for _, m := range matches {
920
+ ch <- m
921
+ }
922
+ close(ch)
923
+ return ch
924
+ }`;
649
925
  const FS_CONSTANTS = {
650
926
  F_OK: 0,
651
927
  R_OK: 4,
@@ -670,8 +946,16 @@ export function registerFs(r) {
670
946
  defineHelper(r, 'uvErrnoOS@other', [], [], uvErrnoTable(''));
671
947
  defineHelper(r, 'uvErrno', [], ['uvErrnoOS@os'], uvErrnoHelper);
672
948
  defineHelper(r, 'fsErrors', ['errors', 'io/fs', 'strings'], ['error', 'uvErrno'], fsErrorsHelper);
673
- defineHelper(r, 'nodeFs', ['errors', 'fmt', 'io', 'io/fs', 'math', 'os', 'path/filepath', 'runtime', 'strconv', 'strings', 'sync', 'time'], ['fsErrors', 'buffer', 'dynamic'], fsHelper);
674
- defineClass(r, 'fs.Stats', '*TnStats', 'class', 'isFile=bool; isDirectory=bool; isSymbolicLink=bool; isFIFO=bool; isSocket=bool; isBlockDevice=bool; isCharacterDevice=bool', 'dev=float64; ino=float64; mode=float64; nlink=float64; uid=float64; gid=float64; rdev=float64; size=float64; blksize=float64; blocks=float64; atimeMs=float64; mtimeMs=float64; ctimeMs=float64; birthtimeMs=float64; atime=time.Time; mtime=time.Time; ctime=time.Time; birthtime=time.Time', '', '');
949
+ defineHelper(r, 'nodeFs', ['errors', 'fmt', 'io', 'io/fs', 'math', 'os', 'path/filepath', 'runtime', 'strconv', 'strings', 'sync', 'time'], ['fsErrors', 'buffer', 'dynamic', 'nodePerm'], fsHelper);
950
+ defineHelper(r, 'nodeFsStatfsOS@linux', ['syscall'], [], statfsOSHelpers.linux);
951
+ for (const goos of ['darwin', 'freebsd', 'openbsd', 'netbsd', 'dragonfly'])
952
+ defineHelper(r, `nodeFsStatfsOS@${goos}`, ['syscall'], [], statfsOSHelpers.bsd);
953
+ defineHelper(r, 'nodeFsStatfsOS@windows', ['os', 'path/filepath', 'syscall', 'unsafe'], [], statfsOSHelpers.windows);
954
+ defineHelper(r, 'nodeFsStatfsOS@other', ['os'], [], statfsOSHelpers.other);
955
+ defineHelper(r, 'nodeFsStatfs', [], ['nodeFs', 'nodeFsStatfsOS@os'], statfsHelper);
956
+ defineHelper(r, 'nodeFsGlob', ['io/fs', 'os', 'path/filepath', 'regexp', 'strings'], ['nodeFs', 'nodePath', 'nodeInvoke', 'dynamic'], globHelper);
957
+ defineClass(r, 'fs.StatsFs', '*TnStatFs', 'class', '', 'bsize=float64; frsize=float64; blocks=float64; bfree=float64; bavail=float64; files=float64; ffree=float64', 'type=float64', '');
958
+ defineClass(r, 'fs.Stats', '*TnStats', 'class', 'isFile=bool; isDirectory=bool; isSymbolicLink=bool; isFIFO=bool; isSocket=bool; isBlockDevice=bool; isCharacterDevice=bool', 'dev=float64; ino=float64; mode=float64; nlink=float64; uid=float64; gid=float64; rdev=float64; size=float64; blksize=float64; blocks=float64; atimeMs=float64; mtimeMs=float64; ctimeMs=float64; birthtimeMs=float64; atime=time.Time; mtime=time.Time; ctime=time.Time; birthtime=time.Time', 'atimeInstant=*TnTemporalInstant; mtimeInstant=*TnTemporalInstant; ctimeInstant=*TnTemporalInstant; birthtimeInstant=*TnTemporalInstant', '');
675
959
  defineClass(r, 'fs.Dirent', '*TnDirent', 'class', 'isFile=bool; isDirectory=bool; isSymbolicLink=bool; isFIFO=bool; isSocket=bool; isBlockDevice=bool; isCharacterDevice=bool', 'name=string; parentPath=string; path=string', '', '');
676
960
  const use = () => r.helper('nodeFs');
677
961
  const fn = (name, result, emit) => {
@@ -683,6 +967,11 @@ export function registerFs(r) {
683
967
  };
684
968
  fn('readFileSync', '', (c) => {
685
969
  const enc = encodingOf(c.nodes[1]);
970
+ // (options.buffer: read into that buffer, a view of its leading bytes)
971
+ if (getOption(c.nodes[1], 'buffer')) {
972
+ const read = `TnReadFileInto(${c.args[0]}, ${c.args[1]})`;
973
+ return readResultType(c, 1) === 'string' ? `TnBufferToString(${read}, ${JSON.stringify(enc)})` : read;
974
+ }
686
975
  if (readResultType(c, 1) === 'string') {
687
976
  const encExpr = enc ? JSON.stringify(enc) : c.types[1] === 'string' ? c.args[1] : '""';
688
977
  return `TnReadFileString(${c.args[0]}, ${encExpr})`;
@@ -704,14 +993,36 @@ export function registerFs(r) {
704
993
  const stat = (lstat) => (c) => {
705
994
  const option = getOption(c.nodes[1], 'throwIfNoEntry');
706
995
  const throwIfNoEntry = option && option.kind === 'FalseKeyword' ? 'false' : 'true';
996
+ // (an aborted options.signal rejects the call)
997
+ if (getOption(c.nodes[1], 'signal'))
998
+ return `func() *TnStats { TnFsCheckSignal(${c.args[1]}); return TnStat(${c.args[0]}, ${lstat}, ${throwIfNoEntry}) }()`;
707
999
  return `TnStat(${c.args[0]}, ${lstat}, ${throwIfNoEntry})`;
708
1000
  };
709
1001
  fn('statSync', '*TnStats', stat(false));
710
1002
  fn('lstatSync', '*TnStats', stat(true));
711
- fn('fstatSync', '*TnStats', (c) => `TnFstat(${c.args[0]})`);
1003
+ fn('fstatSync', '*TnStats', (c) => (getOption(c.nodes[1], 'signal') ? `func() *TnStats { TnFsCheckSignal(${c.args[1]}); return TnFstat(${c.args[0]}) }()` : `TnFstat(${c.args[0]})`));
1004
+ fn('statfsSync', '*TnStatFs', (c) => {
1005
+ r.helper('nodeFsStatfs');
1006
+ return `TnStatfs(${c.args[0]})`;
1007
+ });
1008
+ // openAsBlobSync(path, { type }): the file's bytes as a Blob
1009
+ fn('openAsBlobSync', '*TnBlob', (c) => {
1010
+ r.helper('nodeStreamWeb');
1011
+ const type = getOption(c.nodes[1], 'type');
1012
+ return `&TnBlob{data: TnReadFileBytes(${c.args[0]}), type_: ${type ? `TnJSString(TnGetValue(${c.args[1]}, "type"))` : '""'}}`;
1013
+ });
1014
+ // glob / globSync(pattern | patterns, { cwd, exclude, withFileTypes, followSymlinks, maxDepth })
1015
+ fn('globSync', '', (c) => {
1016
+ r.helper('nodeFsGlob');
1017
+ if (optionIsTrue(c.nodes[1], 'withFileTypes'))
1018
+ return `TnGlobDirentsSync(${c.args[0]}, ${c.args[1]})`;
1019
+ return `TnGlobSync(${c.args.join(', ')})`;
1020
+ });
1021
+ r.typers['fs.globSync'] = (c) => (optionIsTrue(c.nodes[1], 'withFileTypes') ? '[]*TnDirent' : '[]string');
712
1022
  fn('renameSync', '', (c) => `TnRename(${c.args[0]}, ${c.args[1]})`);
713
1023
  fn('rmSync', '', (c) => `TnRm(${c.args[0]}, ${optionIsTrue(c.nodes[1], 'recursive')}, ${optionIsTrue(c.nodes[1], 'force')})`);
714
- fn('rmdirSync', '', (c) => `TnRmdir(${c.args[0]}, ${optionIsTrue(c.nodes[1], 'recursive')})`);
1024
+ // (rmdir's recursive option is gone in Node 25: rmSync({ recursive }) removes trees)
1025
+ fn('rmdirSync', '', (c) => `TnRmdir(${c.args[0]}, false)`);
715
1026
  fn('unlinkSync', '', (c) => `TnUnlink(${c.args[0]})`);
716
1027
  fn('copyFileSync', '', (c) => `TnCopyFile(${c.args[0]}, ${c.args[1]}, ${c.args[2] ?? '0'})`);
717
1028
  fn('cpSync', '', (c) => {
@@ -741,6 +1052,8 @@ export function registerFs(r) {
741
1052
  const value = FS_CONSTANTS[name];
742
1053
  r.values[`fs.constants.${name}`] = (_c) => `float64(${value})`;
743
1054
  r.valueTypes[`fs.constants.${name}`] = 'float64';
1055
+ if (name.endsWith('_OK'))
1056
+ continue;
744
1057
  r.values[`fs.${name}`] = r.values[`fs.constants.${name}`];
745
1058
  r.valueTypes[`fs.${name}`] = 'float64';
746
1059
  }
@@ -808,7 +1121,8 @@ func TnFsExists(path string, cb interface{}) {
808
1121
  TnLoopRef()
809
1122
  ctx := TnAsyncSnapshot()
810
1123
  go func() {
811
- exists := TnExists(path)
1124
+ // (a path the permission model denies doesn't exist for the callback)
1125
+ exists := !tnPermDenied("fs.read", path) && TnExists(path)
812
1126
  TnLoopPost(func() {
813
1127
  defer TnLoopUnref()
814
1128
  TnAsyncRun(ctx, func() { TnInvoke(cb, exists) })
@@ -818,7 +1132,10 @@ func TnFsExists(path string, cb interface{}) {
818
1132
 
819
1133
  // fs/promises FileHandle
820
1134
  type TnFileHandle struct {
821
- fd float64
1135
+ fd float64
1136
+ mu sync.Mutex
1137
+ closed bool
1138
+ locked bool
822
1139
  }
823
1140
 
824
1141
  type TnFsReadResult struct {
@@ -888,8 +1205,1008 @@ func (h *TnFileHandle) sync() chan struct{} {
888
1205
  return TnFsPromiseVoid(func() { TnFsync(h.fd) })
889
1206
  }
890
1207
 
1208
+ func (h *TnFileHandle) closeSync() {
1209
+ h.mu.Lock()
1210
+ if h.closed {
1211
+ h.mu.Unlock()
1212
+ return
1213
+ }
1214
+ fd := h.fd
1215
+ h.closed = true
1216
+ h.fd = -1
1217
+ h.mu.Unlock()
1218
+ if fd >= 0 {
1219
+ TnClose(fd)
1220
+ }
1221
+ }
1222
+
891
1223
  func (h *TnFileHandle) close() chan struct{} {
892
- return TnFsPromiseVoid(func() { TnClose(h.fd) })
1224
+ return TnFsPromiseVoid(func() { h.closeSync() })
1225
+ }
1226
+
1227
+ func (h *TnFileHandle) checkAvailable() {
1228
+ h.mu.Lock()
1229
+ closed, locked := h.closed || h.fd < 0, h.locked
1230
+ h.mu.Unlock()
1231
+ if closed {
1232
+ panic(TnNodeError("Error", "ERR_INVALID_STATE", "The FileHandle is closed"))
1233
+ }
1234
+ if locked {
1235
+ panic(TnNodeError("Error", "ERR_INVALID_STATE", "The FileHandle is locked"))
1236
+ }
1237
+ }
1238
+
1239
+ func (h *TnFileHandle) lockForIteration() float64 {
1240
+ h.mu.Lock()
1241
+ defer h.mu.Unlock()
1242
+ if h.closed || h.fd < 0 {
1243
+ panic(TnNodeError("Error", "ERR_INVALID_STATE", "The FileHandle is closed"))
1244
+ }
1245
+ if h.locked {
1246
+ panic(TnNodeError("Error", "ERR_INVALID_STATE", "The FileHandle is locked"))
1247
+ }
1248
+ h.locked = true
1249
+ return h.fd
1250
+ }
1251
+
1252
+ func (h *TnFileHandle) unlock() {
1253
+ h.mu.Lock()
1254
+ h.locked = false
1255
+ h.mu.Unlock()
1256
+ }
1257
+
1258
+ // FileHandle pull / pullSync / writer (stream/iter)
1259
+ const tnFsDefaultChunkSize = 131072
1260
+
1261
+ type tnFileIterOpts struct {
1262
+ autoClose bool
1263
+ chunkSize int
1264
+ start int64
1265
+ limit int64
1266
+ signal interface{}
1267
+ }
1268
+
1269
+ func tnFsParseIterOpts(opts interface{}, allowSignal bool) tnFileIterOpts {
1270
+ res := tnFileIterOpts{
1271
+ chunkSize: tnFsDefaultChunkSize,
1272
+ start: -1,
1273
+ limit: -1,
1274
+ }
1275
+ if opts == nil {
1276
+ return res
1277
+ }
1278
+ if v := TnGetValue(opts, "autoClose"); v != nil {
1279
+ b, ok := v.(bool)
1280
+ if !ok {
1281
+ panic(TnNodeError("TypeError", "ERR_INVALID_ARG_TYPE", "The \\"options.autoClose\\" property must be of type boolean"))
1282
+ }
1283
+ res.autoClose = b
1284
+ }
1285
+ if v := TnGetValue(opts, "start"); v != nil {
1286
+ f, ok := v.(float64)
1287
+ if !ok {
1288
+ panic(TnNodeError("TypeError", "ERR_INVALID_ARG_TYPE", "The \\"options.start\\" property must be of type number"))
1289
+ }
1290
+ if math.IsNaN(f) || math.IsInf(f, 0) || math.Trunc(f) != f || f < 0 {
1291
+ panic(TnNodeError("RangeError", "ERR_OUT_OF_RANGE", fmt.Sprintf("The value of \\"options.start\\" is out of range. It must be >= 0. Received %v", f)))
1292
+ }
1293
+ res.start = int64(f)
1294
+ }
1295
+ if v := TnGetValue(opts, "limit"); v != nil {
1296
+ f, ok := v.(float64)
1297
+ if !ok {
1298
+ panic(TnNodeError("TypeError", "ERR_INVALID_ARG_TYPE", "The \\"options.limit\\" property must be of type number"))
1299
+ }
1300
+ if math.IsNaN(f) || math.IsInf(f, 0) || math.Trunc(f) != f || f < 1 {
1301
+ panic(TnNodeError("RangeError", "ERR_OUT_OF_RANGE", fmt.Sprintf("The value of \\"options.limit\\" is out of range. It must be >= 1. Received %v", f)))
1302
+ }
1303
+ res.limit = int64(f)
1304
+ }
1305
+ if v := TnGetValue(opts, "chunkSize"); v != nil {
1306
+ f, ok := v.(float64)
1307
+ if !ok {
1308
+ panic(TnNodeError("TypeError", "ERR_INVALID_ARG_TYPE", "The \\"options.chunkSize\\" property must be of type number"))
1309
+ }
1310
+ if math.IsNaN(f) || math.IsInf(f, 0) || math.Trunc(f) != f || f < 1 {
1311
+ panic(TnNodeError("RangeError", "ERR_OUT_OF_RANGE", fmt.Sprintf("The value of \\"options.chunkSize\\" is out of range. It must be >= 1. Received %v", f)))
1312
+ }
1313
+ res.chunkSize = int(f)
1314
+ }
1315
+ if allowSignal {
1316
+ if v := TnGetValue(opts, "signal"); v != nil {
1317
+ res.signal = v
1318
+ }
1319
+ }
1320
+ return res
1321
+ }
1322
+
1323
+ type tnFsStatefulTransform interface {
1324
+ tnTransformSeq(seq iter.Seq[[][]byte], signal interface{}) iter.Seq[[][]byte]
1325
+ }
1326
+
1327
+ func tnFsIsStatefulTransform(a interface{}) bool {
1328
+ if _, ok := a.(tnFsStatefulTransform); ok {
1329
+ return true
1330
+ }
1331
+ if tf := TnGetValue(a, "transform"); tf != nil && reflect.ValueOf(tf).Kind() == reflect.Func {
1332
+ return true
1333
+ }
1334
+ return false
1335
+ }
1336
+
1337
+ func tnFsParsePullArgs(args []interface{}, allowSignal bool) ([]interface{}, tnFileIterOpts) {
1338
+ var transforms []interface{}
1339
+ var optsArg interface{}
1340
+ for i, a := range args {
1341
+ if a == nil {
1342
+ continue
1343
+ }
1344
+ if reflect.ValueOf(a).Kind() == reflect.Func || tnFsIsStatefulTransform(a) {
1345
+ transforms = append(transforms, a)
1346
+ continue
1347
+ }
1348
+ if i == len(args)-1 {
1349
+ optsArg = a
1350
+ }
1351
+ }
1352
+ return transforms, tnFsParseIterOpts(optsArg, allowSignal)
1353
+ }
1354
+
1355
+ func tnFsReadChunk(fd float64, toRead int, pos int64) []byte {
1356
+ f := tnFile(fd)
1357
+ buf := make([]byte, toRead)
1358
+ var n int
1359
+ var err error
1360
+ if pos >= 0 {
1361
+ n, err = f.ReadAt(buf, pos)
1362
+ } else {
1363
+ n, err = f.Read(buf)
1364
+ }
1365
+ if err != nil && err != io.EOF {
1366
+ tnFsCheck(err, "read", "")
1367
+ }
1368
+ if n == 0 {
1369
+ return nil
1370
+ }
1371
+ return buf[:n]
1372
+ }
1373
+
1374
+ func tnFsToBytes(v interface{}) ([]byte, *TnError) {
1375
+ switch x := v.(type) {
1376
+ case []byte:
1377
+ return x, nil
1378
+ case string:
1379
+ return []byte(x), nil
1380
+ }
1381
+ return nil, TnNodeError("TypeError", "ERR_INVALID_ARG_TYPE", "The \\"chunk\\" argument must be an instance of Uint8Array or a string")
1382
+ }
1383
+
1384
+ func tnFsToByteSlice(v interface{}) ([][]byte, *TnError) {
1385
+ switch x := v.(type) {
1386
+ case [][]byte:
1387
+ return x, nil
1388
+ case []string:
1389
+ out := make([][]byte, len(x))
1390
+ for i, s := range x {
1391
+ out[i] = []byte(s)
1392
+ }
1393
+ return out, nil
1394
+ case []interface{}:
1395
+ out := make([][]byte, len(x))
1396
+ for i, el := range x {
1397
+ b, err := tnFsToBytes(el)
1398
+ if err != nil {
1399
+ return nil, err
1400
+ }
1401
+ out[i] = b
1402
+ }
1403
+ return out, nil
1404
+ }
1405
+ return nil, TnNodeError("TypeError", "ERR_INVALID_ARG_TYPE", "The \\"chunks\\" argument must be an array of Uint8Array or string")
1406
+ }
1407
+
1408
+ func tnFsNormalizeBatch(v interface{}) [][]byte {
1409
+ if v == nil {
1410
+ return nil
1411
+ }
1412
+ switch x := v.(type) {
1413
+ case [][]byte:
1414
+ if len(x) == 0 {
1415
+ return nil
1416
+ }
1417
+ return x
1418
+ case []byte:
1419
+ return [][]byte{x}
1420
+ case string:
1421
+ return [][]byte{[]byte(x)}
1422
+ case []string:
1423
+ if len(x) == 0 {
1424
+ return nil
1425
+ }
1426
+ out := make([][]byte, len(x))
1427
+ for i, s := range x {
1428
+ out[i] = []byte(s)
1429
+ }
1430
+ return out
1431
+ case []interface{}:
1432
+ if len(x) == 0 {
1433
+ return nil
1434
+ }
1435
+ out := make([][]byte, 0, len(x))
1436
+ for _, el := range x {
1437
+ if b, err := tnFsToBytes(el); err == nil {
1438
+ out = append(out, b)
1439
+ }
1440
+ }
1441
+ if len(out) == 0 {
1442
+ return nil
1443
+ }
1444
+ return out
1445
+ }
1446
+ return nil
1447
+ }
1448
+
1449
+ func tnFsApplyTransforms(transforms []interface{}, batch [][]byte, async bool, signal interface{}) [][]byte {
1450
+ if len(transforms) == 0 {
1451
+ return batch
1452
+ }
1453
+ cur := batch
1454
+ var arg interface{}
1455
+ if cur != nil {
1456
+ arg = cur
1457
+ }
1458
+ for _, tr := range transforms {
1459
+ var res interface{}
1460
+ if async && signal != nil {
1461
+ res = TnInvoke(tr, arg, map[string]interface{}{"signal": signal})
1462
+ } else {
1463
+ res = TnInvoke(tr, arg)
1464
+ }
1465
+ if async {
1466
+ res = TnAwaitValue(res, false)
1467
+ }
1468
+ cur = tnFsNormalizeBatch(res)
1469
+ if cur == nil {
1470
+ return nil
1471
+ }
1472
+ arg = cur
1473
+ }
1474
+ return cur
1475
+ }
1476
+
1477
+ func tnFsFlushTransforms(transforms []interface{}, async bool, signal interface{}, emit func([][]byte) bool) {
1478
+ for i, tr := range transforms {
1479
+ var res interface{}
1480
+ if async && signal != nil {
1481
+ res = TnInvoke(tr, nil, map[string]interface{}{"signal": signal})
1482
+ } else {
1483
+ res = TnInvoke(tr, nil)
1484
+ }
1485
+ if async {
1486
+ res = TnAwaitValue(res, false)
1487
+ }
1488
+ cur := tnFsNormalizeBatch(res)
1489
+ if cur != nil && i+1 < len(transforms) {
1490
+ cur = tnFsApplyTransforms(transforms[i+1:], cur, async, signal)
1491
+ }
1492
+ if len(cur) > 0 {
1493
+ if !emit(cur) {
1494
+ return
1495
+ }
1496
+ }
1497
+ }
1498
+ }
1499
+
1500
+ func tnFsHasStatefulTransform(transforms []interface{}) bool {
1501
+ for _, tr := range transforms {
1502
+ if tnFsIsStatefulTransform(tr) {
1503
+ return true
1504
+ }
1505
+ }
1506
+ return false
1507
+ }
1508
+
1509
+ func tnFsComposeTransforms(base iter.Seq[[][]byte], transforms []interface{}, async bool, signal interface{}) iter.Seq[[][]byte] {
1510
+ seq := base
1511
+ for _, tr := range transforms {
1512
+ curSeq := seq
1513
+ curTr := tr
1514
+ if st, ok := curTr.(tnFsStatefulTransform); ok {
1515
+ outSeq := st.tnTransformSeq(curSeq, signal)
1516
+ seq = func(yield func([][]byte) bool) {
1517
+ for batch := range outSeq {
1518
+ if len(batch) > 0 {
1519
+ if !yield(batch) {
1520
+ return
1521
+ }
1522
+ }
1523
+ }
1524
+ yield(nil)
1525
+ }
1526
+ } else {
1527
+ seq = func(yield func([][]byte) bool) {
1528
+ for batch := range curSeq {
1529
+ var arg interface{}
1530
+ if batch != nil {
1531
+ arg = batch
1532
+ }
1533
+ var res interface{}
1534
+ if async && signal != nil {
1535
+ res = TnInvoke(curTr, arg, map[string]interface{}{"signal": signal})
1536
+ } else {
1537
+ res = TnInvoke(curTr, arg)
1538
+ }
1539
+ if async {
1540
+ res = TnAwaitValue(res, false)
1541
+ }
1542
+ out := tnFsNormalizeBatch(res)
1543
+ if len(out) > 0 {
1544
+ if !yield(out) {
1545
+ return
1546
+ }
1547
+ }
1548
+ if batch == nil {
1549
+ yield(nil)
1550
+ return
1551
+ }
1552
+ }
1553
+ }
1554
+ }
1555
+ }
1556
+ return seq
1557
+ }
1558
+
1559
+ type TnFilePull struct {
1560
+ handle *TnFileHandle
1561
+ opts tnFileIterOpts
1562
+ transforms []interface{}
1563
+ }
1564
+
1565
+ func (h *TnFileHandle) pull(args ...interface{}) *TnFilePull {
1566
+ h.checkAvailable()
1567
+ transforms, opts := tnFsParsePullArgs(args, true)
1568
+ return &TnFilePull{handle: h, opts: opts, transforms: transforms}
1569
+ }
1570
+
1571
+ func (p *TnFilePull) tnIterator() iter.Seq[[][]byte] {
1572
+ return func(yield func([][]byte) bool) {
1573
+ fd := p.handle.lockForIteration()
1574
+ TnLoopRef()
1575
+ defer func() {
1576
+ p.handle.unlock()
1577
+ TnLoopUnref()
1578
+ if p.opts.autoClose {
1579
+ p.handle.closeSync()
1580
+ }
1581
+ }()
1582
+ pos := p.opts.start
1583
+ remaining := p.opts.limit
1584
+ readSize := p.opts.chunkSize
1585
+ signal := p.opts.signal
1586
+ if tnFsHasStatefulTransform(p.transforms) {
1587
+ base := func(emit func([][]byte) bool) {
1588
+ for remaining != 0 {
1589
+ if signal != nil && TnTruthy(TnGetValue(signal, "aborted")) {
1590
+ panic(TnGetValue(signal, "reason"))
1591
+ }
1592
+ toRead := readSize
1593
+ if remaining > 0 && int64(toRead) > remaining {
1594
+ toRead = int(remaining)
1595
+ }
1596
+ curPos := pos
1597
+ chunk := TnAwait(TnFsPromise(func() []byte {
1598
+ return tnFsReadChunk(fd, toRead, curPos)
1599
+ }))
1600
+ if len(chunk) == 0 {
1601
+ break
1602
+ }
1603
+ if pos >= 0 {
1604
+ pos += int64(len(chunk))
1605
+ }
1606
+ if remaining > 0 {
1607
+ remaining -= int64(len(chunk))
1608
+ }
1609
+ if !emit([][]byte{chunk}) {
1610
+ return
1611
+ }
1612
+ }
1613
+ emit(nil)
1614
+ }
1615
+ for batch := range tnFsComposeTransforms(base, p.transforms, true, signal) {
1616
+ if len(batch) > 0 {
1617
+ if !yield(batch) {
1618
+ return
1619
+ }
1620
+ }
1621
+ }
1622
+ return
1623
+ }
1624
+ for remaining != 0 {
1625
+ if signal != nil && TnTruthy(TnGetValue(signal, "aborted")) {
1626
+ panic(TnGetValue(signal, "reason"))
1627
+ }
1628
+ toRead := readSize
1629
+ if remaining > 0 && int64(toRead) > remaining {
1630
+ toRead = int(remaining)
1631
+ }
1632
+ curPos := pos
1633
+ chunk := TnAwait(TnFsPromise(func() []byte {
1634
+ return tnFsReadChunk(fd, toRead, curPos)
1635
+ }))
1636
+ if len(chunk) == 0 {
1637
+ break
1638
+ }
1639
+ if pos >= 0 {
1640
+ pos += int64(len(chunk))
1641
+ }
1642
+ if remaining > 0 {
1643
+ remaining -= int64(len(chunk))
1644
+ }
1645
+ batch := tnFsApplyTransforms(p.transforms, [][]byte{chunk}, true, signal)
1646
+ if len(batch) > 0 {
1647
+ if !yield(batch) {
1648
+ return
1649
+ }
1650
+ }
1651
+ }
1652
+ if len(p.transforms) > 0 {
1653
+ tnFsFlushTransforms(p.transforms, true, signal, yield)
1654
+ }
1655
+ }
1656
+ }
1657
+
1658
+ type TnFilePullSync struct {
1659
+ handle *TnFileHandle
1660
+ opts tnFileIterOpts
1661
+ transforms []interface{}
1662
+ }
1663
+
1664
+ func (h *TnFileHandle) pullSync(args ...interface{}) *TnFilePullSync {
1665
+ h.checkAvailable()
1666
+ transforms, opts := tnFsParsePullArgs(args, false)
1667
+ return &TnFilePullSync{handle: h, opts: opts, transforms: transforms}
1668
+ }
1669
+
1670
+ func (p *TnFilePullSync) tnIterator() iter.Seq[[][]byte] {
1671
+ return func(yield func([][]byte) bool) {
1672
+ fd := p.handle.lockForIteration()
1673
+ defer func() {
1674
+ p.handle.unlock()
1675
+ if p.opts.autoClose {
1676
+ p.handle.closeSync()
1677
+ }
1678
+ }()
1679
+ pos := p.opts.start
1680
+ remaining := p.opts.limit
1681
+ readSize := p.opts.chunkSize
1682
+ if tnFsHasStatefulTransform(p.transforms) {
1683
+ base := func(emit func([][]byte) bool) {
1684
+ for remaining != 0 {
1685
+ toRead := readSize
1686
+ if remaining > 0 && int64(toRead) > remaining {
1687
+ toRead = int(remaining)
1688
+ }
1689
+ chunk := tnFsReadChunk(fd, toRead, pos)
1690
+ if len(chunk) == 0 {
1691
+ break
1692
+ }
1693
+ if pos >= 0 {
1694
+ pos += int64(len(chunk))
1695
+ }
1696
+ if remaining > 0 {
1697
+ remaining -= int64(len(chunk))
1698
+ }
1699
+ if !emit([][]byte{chunk}) {
1700
+ return
1701
+ }
1702
+ }
1703
+ emit(nil)
1704
+ }
1705
+ for batch := range tnFsComposeTransforms(base, p.transforms, false, nil) {
1706
+ if len(batch) > 0 {
1707
+ if !yield(batch) {
1708
+ return
1709
+ }
1710
+ }
1711
+ }
1712
+ return
1713
+ }
1714
+ for remaining != 0 {
1715
+ toRead := readSize
1716
+ if remaining > 0 && int64(toRead) > remaining {
1717
+ toRead = int(remaining)
1718
+ }
1719
+ chunk := tnFsReadChunk(fd, toRead, pos)
1720
+ if len(chunk) == 0 {
1721
+ break
1722
+ }
1723
+ if pos >= 0 {
1724
+ pos += int64(len(chunk))
1725
+ }
1726
+ if remaining > 0 {
1727
+ remaining -= int64(len(chunk))
1728
+ }
1729
+ batch := tnFsApplyTransforms(p.transforms, [][]byte{chunk}, false, nil)
1730
+ if len(batch) > 0 {
1731
+ if !yield(batch) {
1732
+ return
1733
+ }
1734
+ }
1735
+ }
1736
+ if len(p.transforms) > 0 {
1737
+ tnFsFlushTransforms(p.transforms, false, nil, yield)
1738
+ }
1739
+ }
1740
+ }
1741
+
1742
+ type TnFileWriter struct {
1743
+ handle *TnFileHandle
1744
+ fd float64
1745
+ mu sync.Mutex
1746
+ autoClose bool
1747
+ pos int64
1748
+ bytesRemaining int64
1749
+ syncThreshold int
1750
+ totalBytesWritten int64
1751
+ closed bool
1752
+ closing bool
1753
+ errored bool
1754
+ released bool
1755
+ errVal interface{}
1756
+ asyncPending int
1757
+ writeTail chan struct{}
1758
+ endDone chan struct{}
1759
+ }
1760
+
1761
+ func (h *TnFileHandle) writer(options ...interface{}) *TnFileWriter {
1762
+ h.checkAvailable()
1763
+ var optsArg interface{}
1764
+ if len(options) > 0 {
1765
+ optsArg = options[0]
1766
+ }
1767
+ opts := tnFsParseIterOpts(optsArg, false)
1768
+ fd := h.lockForIteration()
1769
+ TnLoopRef()
1770
+ return &TnFileWriter{
1771
+ handle: h,
1772
+ fd: fd,
1773
+ autoClose: opts.autoClose,
1774
+ pos: opts.start,
1775
+ bytesRemaining: opts.limit,
1776
+ syncThreshold: opts.chunkSize,
1777
+ }
1778
+ }
1779
+
1780
+ func (w *TnFileWriter) releaseLocked() {
1781
+ if w.released {
1782
+ return
1783
+ }
1784
+ w.released = true
1785
+ w.handle.unlock()
1786
+ TnLoopUnref()
1787
+ if w.autoClose {
1788
+ w.handle.closeSync()
1789
+ }
1790
+ }
1791
+
1792
+ func (w *TnFileWriter) writeBufAll(b []byte, position int64) (int64, error) {
1793
+ f := tnFile(w.fd)
1794
+ var written int64
1795
+ for len(b) > 0 {
1796
+ var n int
1797
+ var err error
1798
+ if position >= 0 {
1799
+ n, err = f.WriteAt(b, position)
1800
+ } else {
1801
+ n, err = f.Write(b)
1802
+ }
1803
+ written += int64(n)
1804
+ if position >= 0 {
1805
+ position += int64(n)
1806
+ }
1807
+ b = b[n:]
1808
+ if err != nil {
1809
+ return written, err
1810
+ }
1811
+ if n == 0 {
1812
+ return written, io.ErrShortWrite
1813
+ }
1814
+ }
1815
+ return written, nil
1816
+ }
1817
+
1818
+ func tnFsWriterSignal(options []interface{}) interface{} {
1819
+ if len(options) > 0 && options[0] != nil {
1820
+ return TnGetValue(options[0], "signal")
1821
+ }
1822
+ return nil
1823
+ }
1824
+
1825
+ func tnFsReject[T any](reason interface{}) chan T {
1826
+ ch := make(chan T, 1)
1827
+ TnReject(ch, reason)
1828
+ return ch
1829
+ }
1830
+
1831
+ func (w *TnFileWriter) write(chunk interface{}, options ...interface{}) chan struct{} {
1832
+ b, typeErr := tnFsToBytes(chunk)
1833
+ if typeErr != nil {
1834
+ panic(typeErr)
1835
+ }
1836
+ signal := tnFsWriterSignal(options)
1837
+ w.mu.Lock()
1838
+ if w.errored {
1839
+ reason := w.errVal
1840
+ w.mu.Unlock()
1841
+ return tnFsReject[struct{}](reason)
1842
+ }
1843
+ if w.closed {
1844
+ w.mu.Unlock()
1845
+ return tnFsReject[struct{}](TnNodeError("TypeError", "ERR_INVALID_STATE", "The writer is closed"))
1846
+ }
1847
+ if w.closing {
1848
+ w.mu.Unlock()
1849
+ return tnFsReject[struct{}](TnNodeError("TypeError", "ERR_INVALID_STATE", "The writer is closing"))
1850
+ }
1851
+ if signal != nil && TnTruthy(TnGetValue(signal, "aborted")) {
1852
+ w.mu.Unlock()
1853
+ return tnFsReject[struct{}](TnGetValue(signal, "reason"))
1854
+ }
1855
+ if w.bytesRemaining >= 0 && int64(len(b)) > w.bytesRemaining {
1856
+ rem := w.bytesRemaining
1857
+ w.mu.Unlock()
1858
+ return tnFsReject[struct{}](TnNodeError("RangeError", "ERR_OUT_OF_RANGE", fmt.Sprintf("The value of \\"write\\" is out of range. It must be <= %d bytes. Received %d", rem, len(b))))
1859
+ }
1860
+ if w.bytesRemaining > 0 {
1861
+ w.bytesRemaining -= int64(len(b))
1862
+ }
1863
+ position := w.pos
1864
+ if w.pos >= 0 {
1865
+ w.pos += int64(len(b))
1866
+ }
1867
+ prev := w.writeTail
1868
+ next := make(chan struct{})
1869
+ w.writeTail = next
1870
+ w.asyncPending++
1871
+ w.mu.Unlock()
1872
+
1873
+ ch := make(chan struct{}, 1)
1874
+ TnLoopRef()
1875
+ go func() {
1876
+ defer TnLoopUnref()
1877
+ if prev != nil {
1878
+ <-prev
1879
+ }
1880
+ defer func() {
1881
+ w.mu.Lock()
1882
+ w.asyncPending--
1883
+ if w.errored && w.asyncPending == 0 {
1884
+ w.releaseLocked()
1885
+ }
1886
+ w.mu.Unlock()
1887
+ close(next)
1888
+ }()
1889
+ w.mu.Lock()
1890
+ if w.errored {
1891
+ reason := w.errVal
1892
+ w.mu.Unlock()
1893
+ TnReject(ch, reason)
1894
+ return
1895
+ }
1896
+ w.mu.Unlock()
1897
+ if signal != nil && TnTruthy(TnGetValue(signal, "aborted")) {
1898
+ TnReject(ch, TnGetValue(signal, "reason"))
1899
+ return
1900
+ }
1901
+ written, err := w.writeBufAll(b, position)
1902
+ w.mu.Lock()
1903
+ w.totalBytesWritten += written
1904
+ w.mu.Unlock()
1905
+ if err != nil {
1906
+ TnReject(ch, TnSysError(err, "write", ""))
1907
+ return
1908
+ }
1909
+ TnAsyncSend(ch, struct{}{})
1910
+ }()
1911
+ return ch
1912
+ }
1913
+
1914
+ func (w *TnFileWriter) writev(chunks interface{}, options ...interface{}) chan struct{} {
1915
+ list, typeErr := tnFsToByteSlice(chunks)
1916
+ if typeErr != nil {
1917
+ panic(typeErr)
1918
+ }
1919
+ totalSize := 0
1920
+ for _, b := range list {
1921
+ totalSize += len(b)
1922
+ }
1923
+ signal := tnFsWriterSignal(options)
1924
+ w.mu.Lock()
1925
+ if w.errored {
1926
+ reason := w.errVal
1927
+ w.mu.Unlock()
1928
+ return tnFsReject[struct{}](reason)
1929
+ }
1930
+ if w.closed {
1931
+ w.mu.Unlock()
1932
+ return tnFsReject[struct{}](TnNodeError("TypeError", "ERR_INVALID_STATE", "The writer is closed"))
1933
+ }
1934
+ if w.closing {
1935
+ w.mu.Unlock()
1936
+ return tnFsReject[struct{}](TnNodeError("TypeError", "ERR_INVALID_STATE", "The writer is closing"))
1937
+ }
1938
+ if signal != nil && TnTruthy(TnGetValue(signal, "aborted")) {
1939
+ w.mu.Unlock()
1940
+ return tnFsReject[struct{}](TnGetValue(signal, "reason"))
1941
+ }
1942
+ if w.bytesRemaining >= 0 && int64(totalSize) > w.bytesRemaining {
1943
+ rem := w.bytesRemaining
1944
+ w.mu.Unlock()
1945
+ return tnFsReject[struct{}](TnNodeError("RangeError", "ERR_OUT_OF_RANGE", fmt.Sprintf("The value of \\"writev\\" is out of range. It must be <= %d bytes. Received %d", rem, totalSize)))
1946
+ }
1947
+ if w.bytesRemaining > 0 {
1948
+ w.bytesRemaining -= int64(totalSize)
1949
+ }
1950
+ position := w.pos
1951
+ if w.pos >= 0 {
1952
+ w.pos += int64(totalSize)
1953
+ }
1954
+ prev := w.writeTail
1955
+ next := make(chan struct{})
1956
+ w.writeTail = next
1957
+ w.asyncPending++
1958
+ w.mu.Unlock()
1959
+
1960
+ joined := make([]byte, 0, totalSize)
1961
+ for _, b := range list {
1962
+ joined = append(joined, b...)
1963
+ }
1964
+ ch := make(chan struct{}, 1)
1965
+ TnLoopRef()
1966
+ go func() {
1967
+ defer TnLoopUnref()
1968
+ if prev != nil {
1969
+ <-prev
1970
+ }
1971
+ defer func() {
1972
+ w.mu.Lock()
1973
+ w.asyncPending--
1974
+ if w.errored && w.asyncPending == 0 {
1975
+ w.releaseLocked()
1976
+ }
1977
+ w.mu.Unlock()
1978
+ close(next)
1979
+ }()
1980
+ w.mu.Lock()
1981
+ if w.errored {
1982
+ reason := w.errVal
1983
+ w.mu.Unlock()
1984
+ TnReject(ch, reason)
1985
+ return
1986
+ }
1987
+ w.mu.Unlock()
1988
+ if signal != nil && TnTruthy(TnGetValue(signal, "aborted")) {
1989
+ TnReject(ch, TnGetValue(signal, "reason"))
1990
+ return
1991
+ }
1992
+ written, err := w.writeBufAll(joined, position)
1993
+ w.mu.Lock()
1994
+ w.totalBytesWritten += written
1995
+ w.mu.Unlock()
1996
+ if err != nil {
1997
+ TnReject(ch, TnSysError(err, "write", ""))
1998
+ return
1999
+ }
2000
+ TnAsyncSend(ch, struct{}{})
2001
+ }()
2002
+ return ch
2003
+ }
2004
+
2005
+ func (w *TnFileWriter) writeSync(chunk interface{}) bool {
2006
+ b, typeErr := tnFsToBytes(chunk)
2007
+ if typeErr != nil {
2008
+ panic(typeErr)
2009
+ }
2010
+ w.mu.Lock()
2011
+ defer w.mu.Unlock()
2012
+ if w.errored || w.closed || w.closing || w.asyncPending > 0 {
2013
+ return false
2014
+ }
2015
+ if len(b) > w.syncThreshold {
2016
+ return false
2017
+ }
2018
+ if len(b) == 0 {
2019
+ return true
2020
+ }
2021
+ if w.bytesRemaining >= 0 && int64(len(b)) > w.bytesRemaining {
2022
+ return false
2023
+ }
2024
+ written, err := w.writeBufAll(b, w.pos)
2025
+ w.totalBytesWritten += written
2026
+ if w.pos >= 0 {
2027
+ w.pos += written
2028
+ }
2029
+ if err != nil {
2030
+ if written == 0 {
2031
+ return false
2032
+ }
2033
+ panic(TnSysError(err, "write", ""))
2034
+ }
2035
+ if w.bytesRemaining > 0 {
2036
+ w.bytesRemaining -= int64(len(b))
2037
+ }
2038
+ return true
2039
+ }
2040
+
2041
+ func (w *TnFileWriter) writevSync(chunks interface{}) bool {
2042
+ list, typeErr := tnFsToByteSlice(chunks)
2043
+ if typeErr != nil {
2044
+ panic(typeErr)
2045
+ }
2046
+ totalSize := 0
2047
+ for _, b := range list {
2048
+ totalSize += len(b)
2049
+ }
2050
+ w.mu.Lock()
2051
+ defer w.mu.Unlock()
2052
+ if w.errored || w.closed || w.closing || w.asyncPending > 0 {
2053
+ return false
2054
+ }
2055
+ if totalSize > w.syncThreshold {
2056
+ return false
2057
+ }
2058
+ if totalSize == 0 {
2059
+ return true
2060
+ }
2061
+ if w.bytesRemaining >= 0 && int64(totalSize) > w.bytesRemaining {
2062
+ return false
2063
+ }
2064
+ joined := make([]byte, 0, totalSize)
2065
+ for _, b := range list {
2066
+ joined = append(joined, b...)
2067
+ }
2068
+ written, err := w.writeBufAll(joined, w.pos)
2069
+ w.totalBytesWritten += written
2070
+ if w.pos >= 0 {
2071
+ w.pos += written
2072
+ }
2073
+ if err != nil {
2074
+ if written == 0 {
2075
+ return false
2076
+ }
2077
+ panic(TnSysError(err, "write", ""))
2078
+ }
2079
+ if w.bytesRemaining > 0 {
2080
+ w.bytesRemaining -= int64(totalSize)
2081
+ }
2082
+ return true
2083
+ }
2084
+
2085
+ func (w *TnFileWriter) end(options ...interface{}) chan float64 {
2086
+ signal := tnFsWriterSignal(options)
2087
+ w.mu.Lock()
2088
+ if w.errored {
2089
+ reason := w.errVal
2090
+ w.mu.Unlock()
2091
+ return tnFsReject[float64](reason)
2092
+ }
2093
+ if w.closed {
2094
+ total := float64(w.totalBytesWritten)
2095
+ w.mu.Unlock()
2096
+ ch := make(chan float64, 1)
2097
+ TnAsyncSend(ch, total)
2098
+ return ch
2099
+ }
2100
+ if w.closing {
2101
+ done := w.endDone
2102
+ w.mu.Unlock()
2103
+ ch := make(chan float64, 1)
2104
+ TnLoopRef()
2105
+ go func() {
2106
+ defer TnLoopUnref()
2107
+ <-done
2108
+ w.mu.Lock()
2109
+ errored, reason, total := w.errored, w.errVal, float64(w.totalBytesWritten)
2110
+ w.mu.Unlock()
2111
+ if errored {
2112
+ TnReject(ch, reason)
2113
+ } else {
2114
+ TnAsyncSend(ch, total)
2115
+ }
2116
+ }()
2117
+ return ch
2118
+ }
2119
+ if signal != nil && TnTruthy(TnGetValue(signal, "aborted")) {
2120
+ w.mu.Unlock()
2121
+ return tnFsReject[float64](TnGetValue(signal, "reason"))
2122
+ }
2123
+ w.closing = true
2124
+ prev := w.writeTail
2125
+ done := make(chan struct{})
2126
+ w.endDone = done
2127
+ w.mu.Unlock()
2128
+
2129
+ ch := make(chan float64, 1)
2130
+ TnLoopRef()
2131
+ go func() {
2132
+ defer TnLoopUnref()
2133
+ if prev != nil {
2134
+ <-prev
2135
+ }
2136
+ w.mu.Lock()
2137
+ if w.errored {
2138
+ reason := w.errVal
2139
+ w.mu.Unlock()
2140
+ close(done)
2141
+ TnReject(ch, reason)
2142
+ return
2143
+ }
2144
+ w.releaseLocked()
2145
+ w.closing = false
2146
+ w.closed = true
2147
+ total := float64(w.totalBytesWritten)
2148
+ w.mu.Unlock()
2149
+ close(done)
2150
+ TnAsyncSend(ch, total)
2151
+ }()
2152
+ return ch
2153
+ }
2154
+
2155
+ func (w *TnFileWriter) endSync() float64 {
2156
+ w.mu.Lock()
2157
+ defer w.mu.Unlock()
2158
+ if w.errored || w.closing || w.asyncPending > 0 {
2159
+ return -1
2160
+ }
2161
+ if w.closed {
2162
+ return float64(w.totalBytesWritten)
2163
+ }
2164
+ w.closed = true
2165
+ w.releaseLocked()
2166
+ return float64(w.totalBytesWritten)
2167
+ }
2168
+
2169
+ func (w *TnFileWriter) fail(reason ...interface{}) {
2170
+ w.mu.Lock()
2171
+ defer w.mu.Unlock()
2172
+ if w.closed || w.errored {
2173
+ return
2174
+ }
2175
+ w.errored = true
2176
+ w.closing = false
2177
+ w.closed = true
2178
+ if len(reason) > 0 && reason[0] != nil {
2179
+ w.errVal = reason[0]
2180
+ } else {
2181
+ w.errVal = TnNodeError("Error", "ERR_INVALID_STATE", "The writer has failed")
2182
+ }
2183
+ if w.asyncPending == 0 {
2184
+ w.releaseLocked()
2185
+ }
2186
+ }
2187
+
2188
+ func (w *TnFileWriter) __dispose() {
2189
+ w.fail()
2190
+ }
2191
+
2192
+ func (w *TnFileWriter) __asyncDispose() chan struct{} {
2193
+ w.mu.Lock()
2194
+ closing, done := w.closing, w.endDone
2195
+ w.mu.Unlock()
2196
+ if closing && done != nil {
2197
+ ch := make(chan struct{}, 1)
2198
+ TnLoopRef()
2199
+ go func() {
2200
+ defer TnLoopUnref()
2201
+ <-done
2202
+ TnAsyncSend(ch, struct{}{})
2203
+ }()
2204
+ return ch
2205
+ }
2206
+ w.fail()
2207
+ ch := make(chan struct{}, 1)
2208
+ TnAsyncSend(ch, struct{}{})
2209
+ return ch
893
2210
  }`;
894
2211
  // Async names → their sync emitters
895
2212
  const FS_ASYNC = [
@@ -914,7 +2231,10 @@ const FS_ASYNC = [
914
2231
  'utimes',
915
2232
  'symlink',
916
2233
  'readlink',
917
- 'link'
2234
+ 'link',
2235
+ 'fstat',
2236
+ 'statfs',
2237
+ 'glob'
918
2238
  ];
919
2239
  // The call without its trailing callback
920
2240
  function withoutCallback(call) {
@@ -934,8 +2254,13 @@ function syncResultType(r, syncKey, call) {
934
2254
  function registerFsAsync(r) {
935
2255
  defineModule(r, 'fs/promises');
936
2256
  r.namespaces['fs.promises'] = 'fs/promises';
937
- defineHelper(r, 'nodeFsAsync', ['fmt', 'io'], ['nodeFs', 'eventLoop', 'promise', 'nodeInvoke'], fsAsyncHelper);
938
- defineClass(r, 'fs/promises.FileHandle', '*TnFileHandle', 'class', 'writeFile=chan struct{}; appendFile=chan struct{}; read=chan *TnFsReadResult; write=chan *TnFsWriteResult; stat=chan *TnStats; truncate=chan struct{}; sync=chan struct{}; close=chan struct{}', '', 'fd=float64', '');
2257
+ defineHelper(r, 'nodeFsAsync', ['fmt', 'io', 'iter', 'math', 'reflect', 'sync'], ['nodeFs', 'eventLoop', 'promise', 'nodeInvoke'], fsAsyncHelper);
2258
+ defineClass(r, 'fs/promises.FileHandle', '*TnFileHandle', 'class', 'writeFile=chan struct{}; appendFile=chan struct{}; read=chan *TnFsReadResult; write=chan *TnFsWriteResult; stat=chan *TnStats; truncate=chan struct{}; sync=chan struct{}; close=chan struct{}; pull=*TnFilePull; pullSync=*TnFilePullSync; writer=*TnFileWriter', '', 'fd=float64', '');
2259
+ defineClass(r, 'fs/promises.FilePull', '*TnFilePull', 'class', 'tnIterator=iter.Seq[[][]byte]', '', '', '');
2260
+ defineClass(r, 'fs/promises.FilePullSync', '*TnFilePullSync', 'class', 'tnIterator=iter.Seq[[][]byte]', '', '', '');
2261
+ defineClass(r, 'fs/promises.FileWriter', '*TnFileWriter', 'class', 'write=chan struct{}; writev=chan struct{}; writeSync=bool; writevSync=bool; end=chan float64; endSync=float64; fail=; __dispose=; __asyncDispose=chan struct{}', '', '', '');
2262
+ r.iterators['*TnFilePull'] = 'tnIterator';
2263
+ r.iterators['*TnFilePullSync'] = 'tnIterator';
939
2264
  defineClass(r, 'fs.ReadResult', '*TnFsReadResult', 'class', '', 'bytesRead=float64; buffer=[]byte', '', '');
940
2265
  defineClass(r, 'fs.WriteResult', '*TnFsWriteResult', 'class', '', 'bytesWritten=float64; buffer=interface{}', '', '');
941
2266
  r.methods['fs/promises.FileHandle#readFile'] = (c) => {
@@ -984,6 +2309,17 @@ function registerFsAsync(r) {
984
2309
  return type ? `chan ${type}` : 'chan struct{}';
985
2310
  };
986
2311
  }
2312
+ // fs.openAsBlob(path, options): a promise (no callback form)
2313
+ r.functions['fs.openAsBlob'] = (call) => {
2314
+ r.helper('nodeFsAsync');
2315
+ return `TnFsPromise(func() *TnBlob { return ${r.functions['fs.openAsBlobSync'](call)} })`;
2316
+ };
2317
+ r.results['fs.openAsBlob'] = 'chan *TnBlob';
2318
+ r.functions['fs/promises.glob'] = (call) => {
2319
+ r.helper('nodeFsAsync');
2320
+ return `TnGlobIter(${r.functions['fs.globSync'](call)})`;
2321
+ };
2322
+ r.typers['fs/promises.glob'] = (call) => (optionIsTrue(call.nodes[1], 'withFileTypes') ? 'chan *TnDirent' : 'chan string');
987
2323
  r.functions['fs.exists'] = (call) => {
988
2324
  r.helper('nodeFsAsync');
989
2325
  return `TnFsExists(${call.args[0]}, ${call.args[1]})`;