@smthrs/platform-bun 0.0.0-stage → 1.0.0-rc.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +73 -0
- package/LICENSE +21 -0
- package/README.md +110 -2
- package/dist/cjs/BunFileSystem.d.ts +44 -0
- package/dist/cjs/BunFileSystem.d.ts.map +1 -0
- package/dist/cjs/BunFileSystem.js +38 -0
- package/dist/cjs/BunFileSystem.js.map +7 -0
- package/dist/cjs/BunHost.d.ts +205 -0
- package/dist/cjs/BunHost.d.ts.map +1 -0
- package/dist/cjs/BunHost.js +148 -0
- package/dist/cjs/BunHost.js.map +7 -0
- package/dist/cjs/index.d.ts +26 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +37 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +1 -0
- package/dist/esm/BunFileSystem.d.ts +44 -0
- package/dist/esm/BunFileSystem.d.ts.map +1 -0
- package/dist/esm/BunFileSystem.js +35 -0
- package/dist/esm/BunFileSystem.js.map +1 -0
- package/dist/esm/BunHost.d.ts +205 -0
- package/dist/esm/BunHost.d.ts.map +1 -0
- package/dist/esm/BunHost.js +248 -0
- package/dist/esm/BunHost.js.map +1 -0
- package/dist/esm/index.d.ts +26 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +26 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/vendor/adapters.json +3067 -0
- package/dist/vendor/bun/BunAddressResolver.d.ts +15 -0
- package/dist/vendor/bun/BunAddressResolver.js +8 -0
- package/dist/vendor/bun/BunChildProcessSpawner.d.ts +8 -0
- package/dist/vendor/bun/BunChildProcessSpawner.js +14 -0
- package/dist/vendor/bun/BunClusterHttp.d.ts +76 -0
- package/dist/vendor/bun/BunClusterHttp.js +39 -0
- package/dist/vendor/bun/BunClusterSocket.d.ts +70 -0
- package/dist/vendor/bun/BunClusterSocket.js +22 -0
- package/dist/vendor/bun/BunCrypto.d.ts +11 -0
- package/dist/vendor/bun/BunCrypto.js +8 -0
- package/dist/vendor/bun/BunDatagramSocket.d.ts +227 -0
- package/dist/vendor/bun/BunDatagramSocket.js +11 -0
- package/dist/vendor/bun/BunDns.d.ts +72 -0
- package/dist/vendor/bun/BunDns.js +12 -0
- package/dist/vendor/bun/BunFileSystem.d.ts +11 -0
- package/dist/vendor/bun/BunFileSystem.js +9 -0
- package/dist/vendor/bun/BunHttpClient.d.ts +10 -0
- package/dist/vendor/bun/BunHttpClient.js +1 -0
- package/dist/vendor/bun/BunHttpPlatform.d.ts +11 -0
- package/dist/vendor/bun/BunHttpPlatform.js +11 -0
- package/dist/vendor/bun/BunHttpServer.d.ts +151 -0
- package/dist/vendor/bun/BunHttpServer.js +38 -0
- package/dist/vendor/bun/BunHttpServerRequest.d.ts +20 -0
- package/dist/vendor/bun/BunHttpServerRequest.js +7 -0
- package/dist/vendor/bun/BunMultipart.d.ts +34 -0
- package/dist/vendor/bun/BunMultipart.js +12 -0
- package/dist/vendor/bun/BunPath.d.ts +27 -0
- package/dist/vendor/bun/BunPath.js +12 -0
- package/dist/vendor/bun/BunRedis.d.ts +53 -0
- package/dist/vendor/bun/BunRedis.js +11 -0
- package/dist/vendor/bun/BunRuntime.d.ts +88 -0
- package/dist/vendor/bun/BunRuntime.js +8 -0
- package/dist/vendor/bun/BunServices.d.ts +37 -0
- package/dist/vendor/bun/BunServices.js +23 -0
- package/dist/vendor/bun/BunSink.d.ts +9 -0
- package/dist/vendor/bun/BunSink.js +12 -0
- package/dist/vendor/bun/BunSocket.d.ts +45 -0
- package/dist/vendor/bun/BunSocket.js +29 -0
- package/dist/vendor/bun/BunSocketServer.d.ts +9 -0
- package/dist/vendor/bun/BunSocketServer.js +21 -0
- package/dist/vendor/bun/BunStdio.d.ts +12 -0
- package/dist/vendor/bun/BunStdio.js +10 -0
- package/dist/vendor/bun/BunStream.d.ts +20 -0
- package/dist/vendor/bun/BunStream.js +30 -0
- package/dist/vendor/bun/BunTerminal.d.ts +24 -0
- package/dist/vendor/bun/BunTerminal.js +10 -0
- package/dist/vendor/bun/BunWorker.d.ts +22 -0
- package/dist/vendor/bun/BunWorker.js +9 -0
- package/dist/vendor/bun/BunWorkerRunner.d.ts +13 -0
- package/dist/vendor/bun/BunWorkerRunner.js +7 -0
- package/dist/vendor/bun/LICENSE +21 -0
- package/dist/vendor/bun/index.d.ts +130 -0
- package/dist/vendor/bun/index.js +121 -0
- package/dist/vendor/chunk-2ZAGBWTH.js +40 -0
- package/dist/vendor/chunk-3SL3HKQA.js +118 -0
- package/dist/vendor/chunk-3WUGYBFU.js +0 -0
- package/dist/vendor/chunk-4WIQ2XN7.js +28 -0
- package/dist/vendor/chunk-5ET7NHI7.js +15 -0
- package/dist/vendor/chunk-6FSJ2PMW.js +53 -0
- package/dist/vendor/chunk-6L2NJEOV.js +62 -0
- package/dist/vendor/chunk-72X6VEVD.js +62 -0
- package/dist/vendor/chunk-7NMJM44J.js +26 -0
- package/dist/vendor/chunk-A7AY2JP7.js +71 -0
- package/dist/vendor/chunk-A7UXCEJA.js +81 -0
- package/dist/vendor/chunk-ADP5LRUF.js +274 -0
- package/dist/vendor/chunk-ASGOJ3XA.js +0 -0
- package/dist/vendor/chunk-AWNTTSHL.js +34 -0
- package/dist/vendor/chunk-BUKVIAEM.js +20 -0
- package/dist/vendor/chunk-BY3SDXID.js +501 -0
- package/dist/vendor/chunk-C3PGUWW5.js +414 -0
- package/dist/vendor/chunk-CL4EIDIY.js +7 -0
- package/dist/vendor/chunk-D2ZL4PLZ.js +93 -0
- package/dist/vendor/chunk-D4HEMNGU.js +22 -0
- package/dist/vendor/chunk-F4V5TRY7.js +85 -0
- package/dist/vendor/chunk-F772LLZ5.js +31 -0
- package/dist/vendor/chunk-FFD6R5JZ.js +104 -0
- package/dist/vendor/chunk-G4HOH7GK.js +65 -0
- package/dist/vendor/chunk-GJN7MEBF.js +18 -0
- package/dist/vendor/chunk-HDV6VIRM.js +48 -0
- package/dist/vendor/chunk-IHV7Z4SW.js +34 -0
- package/dist/vendor/chunk-IWSDM4CG.js +16 -0
- package/dist/vendor/chunk-JOQDB2HC.js +26 -0
- package/dist/vendor/chunk-KABHKTVG.js +18 -0
- package/dist/vendor/chunk-KFDBU6RR.js +60 -0
- package/dist/vendor/chunk-KHPN5DWT.js +20 -0
- package/dist/vendor/chunk-LNWGIDIG.js +20 -0
- package/dist/vendor/chunk-MLKGABMK.js +9 -0
- package/dist/vendor/chunk-MUEED3C3.js +144 -0
- package/dist/vendor/chunk-N6TK35N5.js +18 -0
- package/dist/vendor/chunk-NQO6V4KI.js +580 -0
- package/dist/vendor/chunk-NUJQMLJP.js +325 -0
- package/dist/vendor/chunk-OF3N2FN4.js +61 -0
- package/dist/vendor/chunk-OGZJACUS.js +57 -0
- package/dist/vendor/chunk-PCEVZYXO.js +63 -0
- package/dist/vendor/chunk-PECOFLCU.js +85 -0
- package/dist/vendor/chunk-PU7QVYND.js +18 -0
- package/dist/vendor/chunk-QGPZPULA.js +51 -0
- package/dist/vendor/chunk-QHR2RC5M.js +109 -0
- package/dist/vendor/chunk-R2YON4A6.js +28 -0
- package/dist/vendor/chunk-R327POEZ.js +18 -0
- package/dist/vendor/chunk-REFJNBQR.js +18 -0
- package/dist/vendor/chunk-RHJ6LV32.js +43 -0
- package/dist/vendor/chunk-RKVXYKHJ.js +29 -0
- package/dist/vendor/chunk-RP3EWS4C.js +0 -0
- package/dist/vendor/chunk-RQH5DSBA.js +249 -0
- package/dist/vendor/chunk-RQQ5TSCD.js +374 -0
- package/dist/vendor/chunk-S6QUQLBV.js +229 -0
- package/dist/vendor/chunk-SCXQLSNW.js +34 -0
- package/dist/vendor/chunk-SD4X5NGU.js +515 -0
- package/dist/vendor/chunk-T332WJRS.js +128 -0
- package/dist/vendor/chunk-T5FQGISI.js +18 -0
- package/dist/vendor/chunk-TBPDCAMH.js +70 -0
- package/dist/vendor/chunk-UFWLKG4I.js +16 -0
- package/dist/vendor/chunk-UPIQ52FQ.js +426 -0
- package/dist/vendor/chunk-UUQXJRMK.js +14 -0
- package/dist/vendor/chunk-UUYTTEDH.js +36 -0
- package/dist/vendor/chunk-V2EB7FHY.js +129 -0
- package/dist/vendor/chunk-VIWU4EBF.js +18 -0
- package/dist/vendor/chunk-WPZDL2D7.js +21 -0
- package/dist/vendor/chunk-X4YPHWAE.js +22 -0
- package/dist/vendor/chunk-XACFQJY7.js +93 -0
- package/dist/vendor/chunk-Y7V6ISZS.js +418 -0
- package/dist/vendor/chunk-YDY5P7GL.js +20 -0
- package/dist/vendor/chunk-ZNKZXDUD.js +18 -0
- package/dist/vendor/chunk-ZS3VW5QR.js +63 -0
- package/dist/vendor/chunk-ZUUCLHBP.js +18 -0
- package/dist/vendor/chunk-ZVJCBTJG.js +131 -0
- package/dist/vendor/cjs/bun/BunAddressResolver.d.ts +15 -0
- package/dist/vendor/cjs/bun/BunAddressResolver.js +1 -0
- package/dist/vendor/cjs/bun/BunChildProcessSpawner.d.ts +8 -0
- package/dist/vendor/cjs/bun/BunChildProcessSpawner.js +1 -0
- package/dist/vendor/cjs/bun/BunClusterHttp.d.ts +76 -0
- package/dist/vendor/cjs/bun/BunClusterHttp.js +1 -0
- package/dist/vendor/cjs/bun/BunClusterSocket.d.ts +70 -0
- package/dist/vendor/cjs/bun/BunClusterSocket.js +1 -0
- package/dist/vendor/cjs/bun/BunCrypto.d.ts +11 -0
- package/dist/vendor/cjs/bun/BunCrypto.js +1 -0
- package/dist/vendor/cjs/bun/BunDatagramSocket.d.ts +227 -0
- package/dist/vendor/cjs/bun/BunDatagramSocket.js +1 -0
- package/dist/vendor/cjs/bun/BunDns.d.ts +72 -0
- package/dist/vendor/cjs/bun/BunDns.js +1 -0
- package/dist/vendor/cjs/bun/BunFileSystem.d.ts +11 -0
- package/dist/vendor/cjs/bun/BunFileSystem.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpClient.d.ts +10 -0
- package/dist/vendor/cjs/bun/BunHttpClient.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpPlatform.d.ts +11 -0
- package/dist/vendor/cjs/bun/BunHttpPlatform.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpServer.d.ts +151 -0
- package/dist/vendor/cjs/bun/BunHttpServer.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpServerRequest.d.ts +20 -0
- package/dist/vendor/cjs/bun/BunHttpServerRequest.js +1 -0
- package/dist/vendor/cjs/bun/BunMultipart.d.ts +34 -0
- package/dist/vendor/cjs/bun/BunMultipart.js +1 -0
- package/dist/vendor/cjs/bun/BunPath.d.ts +27 -0
- package/dist/vendor/cjs/bun/BunPath.js +1 -0
- package/dist/vendor/cjs/bun/BunRedis.d.ts +53 -0
- package/dist/vendor/cjs/bun/BunRedis.js +1 -0
- package/dist/vendor/cjs/bun/BunRuntime.d.ts +88 -0
- package/dist/vendor/cjs/bun/BunRuntime.js +1 -0
- package/dist/vendor/cjs/bun/BunServices.d.ts +37 -0
- package/dist/vendor/cjs/bun/BunServices.js +1 -0
- package/dist/vendor/cjs/bun/BunSink.d.ts +9 -0
- package/dist/vendor/cjs/bun/BunSink.js +1 -0
- package/dist/vendor/cjs/bun/BunSocket.d.ts +45 -0
- package/dist/vendor/cjs/bun/BunSocket.js +1 -0
- package/dist/vendor/cjs/bun/BunSocketServer.d.ts +9 -0
- package/dist/vendor/cjs/bun/BunSocketServer.js +1 -0
- package/dist/vendor/cjs/bun/BunStdio.d.ts +12 -0
- package/dist/vendor/cjs/bun/BunStdio.js +1 -0
- package/dist/vendor/cjs/bun/BunStream.d.ts +20 -0
- package/dist/vendor/cjs/bun/BunStream.js +1 -0
- package/dist/vendor/cjs/bun/BunTerminal.d.ts +24 -0
- package/dist/vendor/cjs/bun/BunTerminal.js +1 -0
- package/dist/vendor/cjs/bun/BunWorker.d.ts +22 -0
- package/dist/vendor/cjs/bun/BunWorker.js +1 -0
- package/dist/vendor/cjs/bun/BunWorkerRunner.d.ts +13 -0
- package/dist/vendor/cjs/bun/BunWorkerRunner.js +1 -0
- package/dist/vendor/cjs/bun/index.d.ts +130 -0
- package/dist/vendor/cjs/bun/index.js +1 -0
- package/dist/vendor/cjs/node/NodeAddressResolver.d.ts +16 -0
- package/dist/vendor/cjs/node/NodeAddressResolver.js +1 -0
- package/dist/vendor/cjs/node/NodeChildProcessSpawner.d.ts +8 -0
- package/dist/vendor/cjs/node/NodeChildProcessSpawner.js +1 -0
- package/dist/vendor/cjs/node/NodeClusterHttp.d.ts +54 -0
- package/dist/vendor/cjs/node/NodeClusterHttp.js +1 -0
- package/dist/vendor/cjs/node/NodeClusterSocket.d.ts +85 -0
- package/dist/vendor/cjs/node/NodeClusterSocket.js +1 -0
- package/dist/vendor/cjs/node/NodeCrypto.d.ts +11 -0
- package/dist/vendor/cjs/node/NodeCrypto.js +1 -0
- package/dist/vendor/cjs/node/NodeDatagramSocket.d.ts +10 -0
- package/dist/vendor/cjs/node/NodeDatagramSocket.js +1 -0
- package/dist/vendor/cjs/node/NodeDns.d.ts +51 -0
- package/dist/vendor/cjs/node/NodeDns.js +1 -0
- package/dist/vendor/cjs/node/NodeFileSystem.d.ts +11 -0
- package/dist/vendor/cjs/node/NodeFileSystem.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpClient.d.ts +198 -0
- package/dist/vendor/cjs/node/NodeHttpClient.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpIncomingMessage.d.ts +64 -0
- package/dist/vendor/cjs/node/NodeHttpIncomingMessage.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpPlatform.d.ts +38 -0
- package/dist/vendor/cjs/node/NodeHttpPlatform.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpServer.d.ts +131 -0
- package/dist/vendor/cjs/node/NodeHttpServer.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpServerRequest.d.ts +32 -0
- package/dist/vendor/cjs/node/NodeHttpServerRequest.js +1 -0
- package/dist/vendor/cjs/node/NodeMultipart.d.ts +50 -0
- package/dist/vendor/cjs/node/NodeMultipart.js +1 -0
- package/dist/vendor/cjs/node/NodeMultipartParser.d.ts +105 -0
- package/dist/vendor/cjs/node/NodeMultipartParser.js +1 -0
- package/dist/vendor/cjs/node/NodePath.d.ts +30 -0
- package/dist/vendor/cjs/node/NodePath.js +1 -0
- package/dist/vendor/cjs/node/NodeRedis.d.ts +78 -0
- package/dist/vendor/cjs/node/NodeRedis.js +1 -0
- package/dist/vendor/cjs/node/NodeRuntime.d.ts +88 -0
- package/dist/vendor/cjs/node/NodeRuntime.js +1 -0
- package/dist/vendor/cjs/node/NodeServices.d.ts +37 -0
- package/dist/vendor/cjs/node/NodeServices.js +1 -0
- package/dist/vendor/cjs/node/NodeSink.d.ts +9 -0
- package/dist/vendor/cjs/node/NodeSink.js +1 -0
- package/dist/vendor/cjs/node/NodeSocket.d.ts +45 -0
- package/dist/vendor/cjs/node/NodeSocket.js +1 -0
- package/dist/vendor/cjs/node/NodeSocketServer.d.ts +9 -0
- package/dist/vendor/cjs/node/NodeSocketServer.js +1 -0
- package/dist/vendor/cjs/node/NodeStdio.d.ts +12 -0
- package/dist/vendor/cjs/node/NodeStdio.js +1 -0
- package/dist/vendor/cjs/node/NodeStream.d.ts +9 -0
- package/dist/vendor/cjs/node/NodeStream.js +1 -0
- package/dist/vendor/cjs/node/NodeTerminal.d.ts +24 -0
- package/dist/vendor/cjs/node/NodeTerminal.js +1 -0
- package/dist/vendor/cjs/node/NodeWorker.d.ts +24 -0
- package/dist/vendor/cjs/node/NodeWorker.js +1 -0
- package/dist/vendor/cjs/node/NodeWorkerRunner.d.ts +13 -0
- package/dist/vendor/cjs/node/NodeWorkerRunner.js +1 -0
- package/dist/vendor/cjs/node/Undici.d.ts +31 -0
- package/dist/vendor/cjs/node/Undici.js +1 -0
- package/dist/vendor/cjs/node/index.d.ts +140 -0
- package/dist/vendor/cjs/node/index.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeAddressResolver.d.ts +13 -0
- package/dist/vendor/cjs/node-shared/NodeAddressResolver.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.d.ts +66 -0
- package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeClusterSocket.d.ts +35 -0
- package/dist/vendor/cjs/node-shared/NodeClusterSocket.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeCrypto.d.ts +30 -0
- package/dist/vendor/cjs/node-shared/NodeCrypto.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeDatagramSocket.d.ts +246 -0
- package/dist/vendor/cjs/node-shared/NodeDatagramSocket.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeDns.d.ts +221 -0
- package/dist/vendor/cjs/node-shared/NodeDns.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeFileSystem.d.ts +12 -0
- package/dist/vendor/cjs/node-shared/NodeFileSystem.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeHttpCompression.d.ts +40 -0
- package/dist/vendor/cjs/node-shared/NodeHttpCompression.js +1 -0
- package/dist/vendor/cjs/node-shared/NodePath.d.ts +30 -0
- package/dist/vendor/cjs/node-shared/NodePath.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeRuntime.d.ts +51 -0
- package/dist/vendor/cjs/node-shared/NodeRuntime.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeSink.d.ts +73 -0
- package/dist/vendor/cjs/node-shared/NodeSink.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeSocket.d.ts +144 -0
- package/dist/vendor/cjs/node-shared/NodeSocket.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeSocketServer.d.ts +87 -0
- package/dist/vendor/cjs/node-shared/NodeSocketServer.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeStdio.d.ts +13 -0
- package/dist/vendor/cjs/node-shared/NodeStdio.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeStream.d.ts +194 -0
- package/dist/vendor/cjs/node-shared/NodeStream.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeTerminal.d.ts +24 -0
- package/dist/vendor/cjs/node-shared/NodeTerminal.js +1 -0
- package/dist/vendor/cjs/node-shared/index.d.ts +85 -0
- package/dist/vendor/cjs/node-shared/index.js +1 -0
- package/dist/vendor/cjs/node-shared/internal/nodeChildProcessSpawner.d.ts +4 -0
- package/dist/vendor/cjs/node-shared/internal/nodeChildProcessSpawner.js +1 -0
- package/dist/vendor/cjs/node-shared/internal/utils.d.ts +2 -0
- package/dist/vendor/cjs/node-shared/internal/utils.js +1 -0
- package/dist/vendor/cjs/package.json +1 -0
- package/dist/vendor/cjs/platform-bun.d.ts +130 -0
- package/dist/vendor/cjs/platform-bun.js +1 -0
- package/dist/vendor/cjs/platform-node-shared.d.ts +85 -0
- package/dist/vendor/cjs/platform-node-shared.js +1 -0
- package/dist/vendor/cjs/platform-node.d.ts +140 -0
- package/dist/vendor/cjs/platform-node.js +1 -0
- package/dist/vendor/node/LICENSE +21 -0
- package/dist/vendor/node/NodeAddressResolver.d.ts +16 -0
- package/dist/vendor/node/NodeAddressResolver.js +8 -0
- package/dist/vendor/node/NodeChildProcessSpawner.d.ts +8 -0
- package/dist/vendor/node/NodeChildProcessSpawner.js +14 -0
- package/dist/vendor/node/NodeClusterHttp.d.ts +54 -0
- package/dist/vendor/node/NodeClusterHttp.js +43 -0
- package/dist/vendor/node/NodeClusterSocket.d.ts +85 -0
- package/dist/vendor/node/NodeClusterSocket.js +30 -0
- package/dist/vendor/node/NodeCrypto.d.ts +11 -0
- package/dist/vendor/node/NodeCrypto.js +8 -0
- package/dist/vendor/node/NodeDatagramSocket.d.ts +10 -0
- package/dist/vendor/node/NodeDatagramSocket.js +12 -0
- package/dist/vendor/node/NodeDns.d.ts +51 -0
- package/dist/vendor/node/NodeDns.js +12 -0
- package/dist/vendor/node/NodeFileSystem.d.ts +11 -0
- package/dist/vendor/node/NodeFileSystem.js +9 -0
- package/dist/vendor/node/NodeHttpClient.d.ts +198 -0
- package/dist/vendor/node/NodeHttpClient.js +46 -0
- package/dist/vendor/node/NodeHttpIncomingMessage.d.ts +64 -0
- package/dist/vendor/node/NodeHttpIncomingMessage.js +10 -0
- package/dist/vendor/node/NodeHttpPlatform.d.ts +38 -0
- package/dist/vendor/node/NodeHttpPlatform.js +16 -0
- package/dist/vendor/node/NodeHttpServer.d.ts +131 -0
- package/dist/vendor/node/NodeHttpServer.js +46 -0
- package/dist/vendor/node/NodeHttpServerRequest.d.ts +32 -0
- package/dist/vendor/node/NodeHttpServerRequest.js +9 -0
- package/dist/vendor/node/NodeMultipart.d.ts +50 -0
- package/dist/vendor/node/NodeMultipart.js +15 -0
- package/dist/vendor/node/NodeMultipartParser.d.ts +105 -0
- package/dist/vendor/node/NodeMultipartParser.js +11 -0
- package/dist/vendor/node/NodePath.d.ts +30 -0
- package/dist/vendor/node/NodePath.js +12 -0
- package/dist/vendor/node/NodeRedis.d.ts +78 -0
- package/dist/vendor/node/NodeRedis.js +11 -0
- package/dist/vendor/node/NodeRuntime.d.ts +88 -0
- package/dist/vendor/node/NodeRuntime.js +8 -0
- package/dist/vendor/node/NodeServices.d.ts +37 -0
- package/dist/vendor/node/NodeServices.js +23 -0
- package/dist/vendor/node/NodeSink.d.ts +9 -0
- package/dist/vendor/node/NodeSink.js +12 -0
- package/dist/vendor/node/NodeSocket.d.ts +45 -0
- package/dist/vendor/node/NodeSocket.js +31 -0
- package/dist/vendor/node/NodeSocketServer.d.ts +9 -0
- package/dist/vendor/node/NodeSocketServer.js +21 -0
- package/dist/vendor/node/NodeStdio.d.ts +12 -0
- package/dist/vendor/node/NodeStdio.js +10 -0
- package/dist/vendor/node/NodeStream.d.ts +9 -0
- package/dist/vendor/node/NodeStream.js +27 -0
- package/dist/vendor/node/NodeTerminal.d.ts +24 -0
- package/dist/vendor/node/NodeTerminal.js +10 -0
- package/dist/vendor/node/NodeWorker.d.ts +24 -0
- package/dist/vendor/node/NodeWorker.js +9 -0
- package/dist/vendor/node/NodeWorkerRunner.d.ts +13 -0
- package/dist/vendor/node/NodeWorkerRunner.js +7 -0
- package/dist/vendor/node/Undici.d.ts +31 -0
- package/dist/vendor/node/Undici.js +9 -0
- package/dist/vendor/node/index.d.ts +140 -0
- package/dist/vendor/node/index.js +130 -0
- package/dist/vendor/node-shared/LICENSE +21 -0
- package/dist/vendor/node-shared/NodeAddressResolver.d.ts +13 -0
- package/dist/vendor/node-shared/NodeAddressResolver.js +7 -0
- package/dist/vendor/node-shared/NodeChildProcessSpawner.d.ts +66 -0
- package/dist/vendor/node-shared/NodeChildProcessSpawner.js +13 -0
- package/dist/vendor/node-shared/NodeClusterSocket.d.ts +35 -0
- package/dist/vendor/node-shared/NodeClusterSocket.js +11 -0
- package/dist/vendor/node-shared/NodeCrypto.d.ts +30 -0
- package/dist/vendor/node-shared/NodeCrypto.js +9 -0
- package/dist/vendor/node-shared/NodeDatagramSocket.d.ts +246 -0
- package/dist/vendor/node-shared/NodeDatagramSocket.js +11 -0
- package/dist/vendor/node-shared/NodeDns.d.ts +221 -0
- package/dist/vendor/node-shared/NodeDns.js +31 -0
- package/dist/vendor/node-shared/NodeFileSystem.d.ts +12 -0
- package/dist/vendor/node-shared/NodeFileSystem.js +8 -0
- package/dist/vendor/node-shared/NodeHttpCompression.d.ts +40 -0
- package/dist/vendor/node-shared/NodeHttpCompression.js +13 -0
- package/dist/vendor/node-shared/NodePath.d.ts +30 -0
- package/dist/vendor/node-shared/NodePath.js +11 -0
- package/dist/vendor/node-shared/NodeRuntime.d.ts +51 -0
- package/dist/vendor/node-shared/NodeRuntime.js +7 -0
- package/dist/vendor/node-shared/NodeSink.d.ts +73 -0
- package/dist/vendor/node-shared/NodeSink.js +11 -0
- package/dist/vendor/node-shared/NodeSocket.d.ts +144 -0
- package/dist/vendor/node-shared/NodeSocket.js +23 -0
- package/dist/vendor/node-shared/NodeSocketServer.d.ts +87 -0
- package/dist/vendor/node-shared/NodeSocketServer.js +20 -0
- package/dist/vendor/node-shared/NodeStdio.d.ts +13 -0
- package/dist/vendor/node-shared/NodeStdio.js +9 -0
- package/dist/vendor/node-shared/NodeStream.d.ts +194 -0
- package/dist/vendor/node-shared/NodeStream.js +26 -0
- package/dist/vendor/node-shared/NodeTerminal.d.ts +24 -0
- package/dist/vendor/node-shared/NodeTerminal.js +9 -0
- package/dist/vendor/node-shared/index.d.ts +85 -0
- package/dist/vendor/node-shared/index.js +70 -0
- package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.d.ts +4 -0
- package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.js +7 -0
- package/dist/vendor/node-shared/internal/utils.d.ts +2 -0
- package/dist/vendor/node-shared/internal/utils.js +7 -0
- package/dist/vendor/platform-bun.d.ts +130 -0
- package/dist/vendor/platform-bun.js +121 -0
- package/dist/vendor/platform-node-shared.d.ts +85 -0
- package/dist/vendor/platform-node-shared.js +70 -0
- package/dist/vendor/platform-node.d.ts +140 -0
- package/dist/vendor/platform-node.js +130 -0
- package/docs/README.md +135 -0
- package/docs/api.md +264 -0
- package/docs/concepts/host-surface.md +152 -0
- package/docs/concepts/runtime-parity.md +80 -0
- package/docs/guides/bind-a-repository-root.md +109 -0
- package/docs/guides/configure-the-filesystem-helper.md +113 -0
- package/docs/guides/contain-child-processes.md +178 -0
- package/docs/installation.md +131 -0
- package/docs/quickstart.md +163 -0
- package/docs/troubleshooting.md +163 -0
- package/package.json +146 -3
- package/src/BunFileSystem.ts +47 -0
- package/src/BunHost.ts +345 -0
- package/src/index.ts +27 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-MLKGABMK.js";
|
|
4
|
+
|
|
5
|
+
// ../../../../node_modules/.pnpm/@effect+platform-node@4.0.4_effect@4.0.4_redis@6.2.1_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeMultipartParser.js
|
|
6
|
+
var NodeMultipartParser_exports = {};
|
|
7
|
+
__export(NodeMultipartParser_exports, {
|
|
8
|
+
FileStream: () => FileStream,
|
|
9
|
+
MultipartStream: () => MultipartStream,
|
|
10
|
+
make: () => make
|
|
11
|
+
});
|
|
12
|
+
import { make as makeParser } from "effect/http/MultipartParser";
|
|
13
|
+
import { Duplex, Readable } from "node:stream";
|
|
14
|
+
var MultipartStream = class extends Duplex {
|
|
15
|
+
_parser;
|
|
16
|
+
_canWrite = true;
|
|
17
|
+
_writeCallback;
|
|
18
|
+
constructor(config) {
|
|
19
|
+
super({
|
|
20
|
+
readableObjectMode: true
|
|
21
|
+
});
|
|
22
|
+
let currentError;
|
|
23
|
+
let currentFile;
|
|
24
|
+
this._parser = makeParser({
|
|
25
|
+
...config,
|
|
26
|
+
onField: (info, value) => {
|
|
27
|
+
if (currentError !== void 0) return;
|
|
28
|
+
const field = {
|
|
29
|
+
_tag: "Field",
|
|
30
|
+
info,
|
|
31
|
+
value
|
|
32
|
+
};
|
|
33
|
+
this.push(field);
|
|
34
|
+
this.emit("field", field);
|
|
35
|
+
},
|
|
36
|
+
onFile: (info) => {
|
|
37
|
+
if (currentError !== void 0) return (_) => {
|
|
38
|
+
};
|
|
39
|
+
const file = new FileStream(info, this);
|
|
40
|
+
currentFile = file;
|
|
41
|
+
this.push(file);
|
|
42
|
+
this.emit("file", file);
|
|
43
|
+
return (chunk) => {
|
|
44
|
+
if (currentError !== void 0) return;
|
|
45
|
+
this._canWrite = file.push(chunk);
|
|
46
|
+
if (chunk === null && !this._canWrite) {
|
|
47
|
+
currentFile = void 0;
|
|
48
|
+
this._resume();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
onError: (error) => {
|
|
53
|
+
this.emit("error", error);
|
|
54
|
+
currentFile?.emit("error", error);
|
|
55
|
+
currentError = error;
|
|
56
|
+
},
|
|
57
|
+
onDone: () => {
|
|
58
|
+
this.push(null);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
_resume() {
|
|
63
|
+
this._canWrite = true;
|
|
64
|
+
if (this._writeCallback !== void 0) {
|
|
65
|
+
const callback = this._writeCallback;
|
|
66
|
+
this._writeCallback = void 0;
|
|
67
|
+
callback();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
_read(_size) {
|
|
71
|
+
}
|
|
72
|
+
_write(chunk, encoding, callback) {
|
|
73
|
+
this._parser.write(chunk instanceof Uint8Array ? chunk : Buffer.from(chunk, encoding));
|
|
74
|
+
if (this._canWrite) {
|
|
75
|
+
callback();
|
|
76
|
+
} else {
|
|
77
|
+
this._writeCallback = callback;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
_final(callback) {
|
|
81
|
+
this._parser.end();
|
|
82
|
+
callback();
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
var make = (config) => new MultipartStream(config);
|
|
86
|
+
var FileStream = class extends Readable {
|
|
87
|
+
_tag = "File";
|
|
88
|
+
filename;
|
|
89
|
+
info;
|
|
90
|
+
_parent;
|
|
91
|
+
constructor(info, parent) {
|
|
92
|
+
super();
|
|
93
|
+
this.info = info;
|
|
94
|
+
this._parent = parent;
|
|
95
|
+
this.filename = info.filename;
|
|
96
|
+
}
|
|
97
|
+
_read(_size) {
|
|
98
|
+
if (this._parent._canWrite === false) {
|
|
99
|
+
this._parent._resume();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export {
|
|
105
|
+
MultipartStream,
|
|
106
|
+
make,
|
|
107
|
+
FileStream,
|
|
108
|
+
NodeMultipartParser_exports
|
|
109
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IncomingMessage,
|
|
3
|
+
layer,
|
|
4
|
+
layerTls,
|
|
5
|
+
layerWebSocket,
|
|
6
|
+
make,
|
|
7
|
+
makeTls,
|
|
8
|
+
makeWebSocket
|
|
9
|
+
} from "./chunk-S6QUQLBV.js";
|
|
10
|
+
import {
|
|
11
|
+
__export
|
|
12
|
+
} from "./chunk-MLKGABMK.js";
|
|
13
|
+
|
|
14
|
+
// ../../../../node_modules/.pnpm/@effect+platform-bun@4.0.4_effect@4.0.4/node_modules/@effect/platform-bun/dist/BunSocketServer.js
|
|
15
|
+
var BunSocketServer_exports = {};
|
|
16
|
+
__export(BunSocketServer_exports, {
|
|
17
|
+
IncomingMessage: () => IncomingMessage,
|
|
18
|
+
layer: () => layer,
|
|
19
|
+
layerTls: () => layerTls,
|
|
20
|
+
layerWebSocket: () => layerWebSocket,
|
|
21
|
+
make: () => make,
|
|
22
|
+
makeTls: () => makeTls,
|
|
23
|
+
makeWebSocket: () => makeWebSocket
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
BunSocketServer_exports
|
|
28
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
flattenCommand,
|
|
3
|
+
layer
|
|
4
|
+
} from "./chunk-NQO6V4KI.js";
|
|
5
|
+
import {
|
|
6
|
+
__export
|
|
7
|
+
} from "./chunk-MLKGABMK.js";
|
|
8
|
+
|
|
9
|
+
// ../../../../node_modules/.pnpm/@effect+platform-node@4.0.4_effect@4.0.4_redis@6.2.1_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeChildProcessSpawner.js
|
|
10
|
+
var NodeChildProcessSpawner_exports = {};
|
|
11
|
+
__export(NodeChildProcessSpawner_exports, {
|
|
12
|
+
flattenCommand: () => flattenCommand,
|
|
13
|
+
layer: () => layer
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
NodeChildProcessSpawner_exports
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runMain
|
|
3
|
+
} from "./chunk-UUYTTEDH.js";
|
|
4
|
+
import {
|
|
5
|
+
__export
|
|
6
|
+
} from "./chunk-MLKGABMK.js";
|
|
7
|
+
|
|
8
|
+
// ../../../../node_modules/.pnpm/@effect+platform-bun@4.0.4_effect@4.0.4/node_modules/@effect/platform-bun/dist/BunRuntime.js
|
|
9
|
+
var BunRuntime_exports = {};
|
|
10
|
+
__export(BunRuntime_exports, {
|
|
11
|
+
runMain: () => runMain2
|
|
12
|
+
});
|
|
13
|
+
var runMain2 = runMain;
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
runMain2 as runMain,
|
|
17
|
+
BunRuntime_exports
|
|
18
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
addressesFromLookup,
|
|
3
|
+
dnsErrorFromCause,
|
|
4
|
+
resolver,
|
|
5
|
+
toFamily
|
|
6
|
+
} from "./chunk-ADP5LRUF.js";
|
|
7
|
+
import {
|
|
8
|
+
__export
|
|
9
|
+
} from "./chunk-MLKGABMK.js";
|
|
10
|
+
|
|
11
|
+
// ../../../../node_modules/.pnpm/@effect+platform-bun@4.0.4_effect@4.0.4/node_modules/@effect/platform-bun/dist/BunDns.js
|
|
12
|
+
var BunDns_exports = {};
|
|
13
|
+
__export(BunDns_exports, {
|
|
14
|
+
layer: () => layer,
|
|
15
|
+
layerConfig: () => layerConfig,
|
|
16
|
+
make: () => make2
|
|
17
|
+
});
|
|
18
|
+
import * as Config from "effect/Config";
|
|
19
|
+
import * as Effect from "effect/Effect";
|
|
20
|
+
import * as Layer from "effect/Layer";
|
|
21
|
+
import * as Dns from "effect/net/Dns";
|
|
22
|
+
var make2 = /* @__PURE__ */ Effect.fnUntraced(function* (options) {
|
|
23
|
+
const resolve = yield* resolver(options);
|
|
24
|
+
return Dns.make({
|
|
25
|
+
lookup: (host, family) => Effect.tryPromise({
|
|
26
|
+
try: () => Bun.dns.lookup(host, {
|
|
27
|
+
family: toFamily(family),
|
|
28
|
+
backend: "system"
|
|
29
|
+
}),
|
|
30
|
+
catch: (cause) => dnsErrorFromCause(cause, "lookup", host)
|
|
31
|
+
}).pipe(Effect.map(addressesFromLookup)),
|
|
32
|
+
resolve
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
var layer = /* @__PURE__ */ Layer.effect(Dns.Dns, /* @__PURE__ */ Effect.orDie(/* @__PURE__ */ make2()));
|
|
36
|
+
var layerConfig = (options) => Layer.effect(Dns.Dns, Effect.flatMap(Config.unwrap(options), make2));
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
make2 as make,
|
|
40
|
+
layer,
|
|
41
|
+
layerConfig,
|
|
42
|
+
BunDns_exports
|
|
43
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-MLKGABMK.js";
|
|
4
|
+
|
|
5
|
+
// ../../../../node_modules/.pnpm/@effect+platform-node-shared@4.0.4_effect@4.0.4/node_modules/@effect/platform-node-shared/dist/NodeAddressResolver.js
|
|
6
|
+
var NodeAddressResolver_exports = {};
|
|
7
|
+
__export(NodeAddressResolver_exports, {
|
|
8
|
+
layer: () => layer2
|
|
9
|
+
});
|
|
10
|
+
import * as Effect from "effect/Effect";
|
|
11
|
+
import * as AddressResolver from "effect/net/AddressResolver";
|
|
12
|
+
import * as NetAddress from "effect/net/NetAddress";
|
|
13
|
+
import * as Os from "node:os";
|
|
14
|
+
var scopeId = (name) => Effect.try({
|
|
15
|
+
try: () => NetAddress.scopeIdFromInterface(Os.networkInterfaces()[name]),
|
|
16
|
+
catch: (cause) => new NetAddress.NetAddressError({
|
|
17
|
+
input: name,
|
|
18
|
+
message: "cannot list network interfaces",
|
|
19
|
+
cause
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
var layer2 = /* @__PURE__ */ AddressResolver.layer({
|
|
23
|
+
scopeId
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
layer2 as layer,
|
|
28
|
+
NodeAddressResolver_exports
|
|
29
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pullIntoWritable
|
|
3
|
+
} from "./chunk-A7UXCEJA.js";
|
|
4
|
+
import {
|
|
5
|
+
__export
|
|
6
|
+
} from "./chunk-MLKGABMK.js";
|
|
7
|
+
|
|
8
|
+
// ../../../../node_modules/.pnpm/@effect+platform-node-shared@4.0.4_effect@4.0.4/node_modules/@effect/platform-node-shared/dist/NodeStream.js
|
|
9
|
+
var NodeStream_exports = {};
|
|
10
|
+
__export(NodeStream_exports, {
|
|
11
|
+
fromDuplex: () => fromDuplex,
|
|
12
|
+
fromReadable: () => fromReadable,
|
|
13
|
+
fromReadableChannel: () => fromReadableChannel,
|
|
14
|
+
pipeThroughDuplex: () => pipeThroughDuplex,
|
|
15
|
+
pipeThroughSimple: () => pipeThroughSimple,
|
|
16
|
+
toArrayBuffer: () => toArrayBuffer,
|
|
17
|
+
toReadable: () => toReadable,
|
|
18
|
+
toReadableNever: () => toReadableNever,
|
|
19
|
+
toString: () => toString,
|
|
20
|
+
toUint8Array: () => toUint8Array
|
|
21
|
+
});
|
|
22
|
+
import * as Arr from "effect/Array";
|
|
23
|
+
import * as ByteSize from "effect/ByteSize";
|
|
24
|
+
import * as Cause from "effect/Cause";
|
|
25
|
+
import * as Channel from "effect/Channel";
|
|
26
|
+
import * as Context from "effect/Context";
|
|
27
|
+
import * as Effect from "effect/Effect";
|
|
28
|
+
import * as Exit from "effect/Exit";
|
|
29
|
+
import * as Fiber from "effect/Fiber";
|
|
30
|
+
import { dual } from "effect/Function";
|
|
31
|
+
import * as Latch from "effect/Latch";
|
|
32
|
+
import * as MutableRef from "effect/MutableRef";
|
|
33
|
+
import * as Pull from "effect/Pull";
|
|
34
|
+
import * as Scope from "effect/Scope";
|
|
35
|
+
import * as Stream from "effect/Stream";
|
|
36
|
+
import { Readable } from "node:stream";
|
|
37
|
+
var fromReadable = (options) => Stream.fromChannel(fromReadableChannel(options));
|
|
38
|
+
var fromReadableChannel = (options) => Channel.fromTransform((_, scope) => readableToPullUnsafe({
|
|
39
|
+
scope,
|
|
40
|
+
readable: options.evaluate(),
|
|
41
|
+
onError: options.onError ?? defaultOnError,
|
|
42
|
+
chunkSize: options.chunkSize,
|
|
43
|
+
closeOnDone: options.closeOnDone
|
|
44
|
+
}));
|
|
45
|
+
var fromDuplex = (options) => Channel.fromTransform((upstream, scope) => {
|
|
46
|
+
const duplex = options.evaluate();
|
|
47
|
+
const exit = MutableRef.make(void 0);
|
|
48
|
+
const latch = Latch.makeUnsafe(false);
|
|
49
|
+
return pullIntoWritable({
|
|
50
|
+
pull: upstream,
|
|
51
|
+
writable: duplex,
|
|
52
|
+
onError: options.onError ?? defaultOnError,
|
|
53
|
+
endOnDone: options.endOnDone,
|
|
54
|
+
encoding: options.encoding
|
|
55
|
+
}).pipe(Effect.catchCause((cause) => {
|
|
56
|
+
if (Pull.isDoneCause(cause)) return Effect.void;
|
|
57
|
+
exit.current = Exit.failCause(cause);
|
|
58
|
+
latch.openUnsafe();
|
|
59
|
+
return Effect.void;
|
|
60
|
+
}), Effect.forkIn(scope), Effect.flatMap(() => readableToPullUnsafe({
|
|
61
|
+
scope,
|
|
62
|
+
exit,
|
|
63
|
+
latch,
|
|
64
|
+
readable: duplex,
|
|
65
|
+
onError: options.onError ?? defaultOnError,
|
|
66
|
+
chunkSize: options.chunkSize
|
|
67
|
+
})));
|
|
68
|
+
});
|
|
69
|
+
var pipeThroughDuplex = /* @__PURE__ */ dual(2, (self, options) => Stream.pipeThroughChannelOrFail(self, fromDuplex(options)));
|
|
70
|
+
var pipeThroughSimple = /* @__PURE__ */ dual(2, (self, duplex) => pipeThroughDuplex(self, {
|
|
71
|
+
evaluate: duplex
|
|
72
|
+
}));
|
|
73
|
+
var toReadable = (stream) => Effect.map(Effect.context(), (context2) => new StreamAdapter(context2, stream));
|
|
74
|
+
var toReadableNever = (stream) => new StreamAdapter(Context.empty(), stream);
|
|
75
|
+
var toString = (readable, options) => {
|
|
76
|
+
const maxBytesNumber = toMaxBytes(options?.maxBytes);
|
|
77
|
+
const onError = options?.onError ?? defaultOnError;
|
|
78
|
+
const encoding = options?.encoding ?? "utf8";
|
|
79
|
+
return Effect.callback((resume) => {
|
|
80
|
+
const stream = readable();
|
|
81
|
+
stream.setEncoding(encoding);
|
|
82
|
+
stream.once("error", (err) => {
|
|
83
|
+
if ("closed" in stream && !stream.closed) {
|
|
84
|
+
stream.destroy();
|
|
85
|
+
}
|
|
86
|
+
resume(Effect.fail(onError(err)));
|
|
87
|
+
});
|
|
88
|
+
let string = "";
|
|
89
|
+
let bytes = 0;
|
|
90
|
+
stream.once("end", () => {
|
|
91
|
+
resume(Effect.succeed(string));
|
|
92
|
+
});
|
|
93
|
+
stream.on("data", (chunk) => {
|
|
94
|
+
string += chunk;
|
|
95
|
+
bytes += Buffer.byteLength(chunk);
|
|
96
|
+
if (maxBytesNumber !== void 0 && bytes > maxBytesNumber) {
|
|
97
|
+
if ("closed" in stream && !stream.closed) {
|
|
98
|
+
stream.destroy();
|
|
99
|
+
}
|
|
100
|
+
resume(Effect.fail(onError(new Error("maxBytes exceeded"))));
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
return Effect.sync(() => {
|
|
104
|
+
if ("closed" in stream && !stream.closed) {
|
|
105
|
+
stream.destroy();
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
var toArrayBuffer = (readable, options) => {
|
|
111
|
+
const maxBytesNumber = toMaxBytes(options?.maxBytes);
|
|
112
|
+
const onError = options?.onError ?? defaultOnError;
|
|
113
|
+
return Effect.callback((resume) => {
|
|
114
|
+
const stream = readable();
|
|
115
|
+
const buffers = [];
|
|
116
|
+
let bytes = 0;
|
|
117
|
+
stream.once("error", (err) => {
|
|
118
|
+
if ("closed" in stream && !stream.closed) {
|
|
119
|
+
stream.destroy();
|
|
120
|
+
}
|
|
121
|
+
resume(Effect.fail(onError(err)));
|
|
122
|
+
});
|
|
123
|
+
stream.once("end", () => {
|
|
124
|
+
const buffer = buffers.length === 1 ? buffers[0] : Buffer.concat(buffers);
|
|
125
|
+
if (buffer.byteOffset === 0 && buffer.buffer.byteLength === buffer.byteLength) {
|
|
126
|
+
return resume(Effect.succeed(buffer.buffer));
|
|
127
|
+
}
|
|
128
|
+
resume(Effect.succeed(buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength)));
|
|
129
|
+
});
|
|
130
|
+
stream.on("data", (chunk) => {
|
|
131
|
+
buffers.push(chunk);
|
|
132
|
+
bytes += chunk.length;
|
|
133
|
+
if (maxBytesNumber !== void 0 && bytes > maxBytesNumber) {
|
|
134
|
+
if ("closed" in stream && !stream.closed) {
|
|
135
|
+
stream.destroy();
|
|
136
|
+
}
|
|
137
|
+
resume(Effect.fail(onError(new Error("maxBytes exceeded"))));
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
return Effect.sync(() => {
|
|
141
|
+
if ("closed" in stream && !stream.closed) {
|
|
142
|
+
stream.destroy();
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
var toUint8Array = (readable, options) => Effect.map(toArrayBuffer(readable, options), (buffer) => new Uint8Array(buffer));
|
|
148
|
+
var readableToPullUnsafe = (options) => {
|
|
149
|
+
const readable = options.readable;
|
|
150
|
+
const closeOnDone = options.closeOnDone ?? true;
|
|
151
|
+
const exit = options.exit ?? MutableRef.make(void 0);
|
|
152
|
+
const latch = options.latch ?? Latch.makeUnsafe(false);
|
|
153
|
+
function onReadable() {
|
|
154
|
+
latch.openUnsafe();
|
|
155
|
+
}
|
|
156
|
+
function onError(error) {
|
|
157
|
+
exit.current = Exit.fail(options.onError(error));
|
|
158
|
+
latch.openUnsafe();
|
|
159
|
+
}
|
|
160
|
+
function onEnd() {
|
|
161
|
+
exit.current = Exit.fail(Cause.Done());
|
|
162
|
+
latch.openUnsafe();
|
|
163
|
+
}
|
|
164
|
+
readable.on("readable", onReadable);
|
|
165
|
+
readable.once("error", onError);
|
|
166
|
+
readable.once("end", onEnd);
|
|
167
|
+
const pull = Effect.suspend(function loop() {
|
|
168
|
+
let item = options.readable.read(options.chunkSize);
|
|
169
|
+
if (item === null) {
|
|
170
|
+
if (exit.current) {
|
|
171
|
+
return exit.current;
|
|
172
|
+
}
|
|
173
|
+
if (readable.readableEnded) {
|
|
174
|
+
return Effect.fail(Cause.Done());
|
|
175
|
+
}
|
|
176
|
+
latch.closeUnsafe();
|
|
177
|
+
return Effect.flatMap(latch.await, loop);
|
|
178
|
+
}
|
|
179
|
+
const chunk = Arr.of(item);
|
|
180
|
+
while (true) {
|
|
181
|
+
item = options.readable.read(options.chunkSize);
|
|
182
|
+
if (item === null) break;
|
|
183
|
+
chunk.push(item);
|
|
184
|
+
}
|
|
185
|
+
return Effect.succeed(chunk);
|
|
186
|
+
});
|
|
187
|
+
return Effect.as(Scope.addFinalizer(options.scope, Effect.sync(() => {
|
|
188
|
+
readable.off("readable", onReadable);
|
|
189
|
+
readable.off("error", onError);
|
|
190
|
+
readable.off("end", onEnd);
|
|
191
|
+
if (closeOnDone && "closed" in options.readable && !options.readable.closed) {
|
|
192
|
+
options.readable.destroy();
|
|
193
|
+
}
|
|
194
|
+
})), pull);
|
|
195
|
+
};
|
|
196
|
+
var StreamAdapter = class extends Readable {
|
|
197
|
+
readLatch;
|
|
198
|
+
fiber = void 0;
|
|
199
|
+
constructor(context2, stream) {
|
|
200
|
+
super({});
|
|
201
|
+
this.readLatch = Latch.makeUnsafe(false);
|
|
202
|
+
this.fiber = Stream.runForEachArray(stream, (chunk) => this.readLatch.whenOpen(Effect.sync(() => {
|
|
203
|
+
this.readLatch.closeUnsafe();
|
|
204
|
+
for (let i = 0; i < chunk.length; i++) {
|
|
205
|
+
const item = chunk[i];
|
|
206
|
+
if (typeof item === "string") {
|
|
207
|
+
this.push(item, "utf8");
|
|
208
|
+
} else {
|
|
209
|
+
this.push(item);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}))).pipe(this.readLatch.whenOpen, Effect.provideContext(context2), Effect.runFork);
|
|
213
|
+
this.fiber.addObserver((exit) => {
|
|
214
|
+
this.fiber = void 0;
|
|
215
|
+
if (Exit.isSuccess(exit)) {
|
|
216
|
+
this.push(null);
|
|
217
|
+
} else {
|
|
218
|
+
this.destroy(Cause.squash(exit.cause));
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
_read(_size) {
|
|
223
|
+
this.readLatch.openUnsafe();
|
|
224
|
+
}
|
|
225
|
+
_destroy(error, callback2) {
|
|
226
|
+
if (!this.fiber) {
|
|
227
|
+
return callback2(error);
|
|
228
|
+
}
|
|
229
|
+
Effect.runFork(Fiber.interrupt(this.fiber)).addObserver((exit) => {
|
|
230
|
+
callback2(exit._tag === "Failure" ? Cause.squash(exit.cause) : error);
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
var defaultOnError = (error) => new Cause.UnknownError(error);
|
|
235
|
+
var toMaxBytes = (maxBytes) => maxBytes === void 0 || maxBytes === Infinity ? void 0 : Number(ByteSize.fromInputUnsafe(maxBytes));
|
|
236
|
+
|
|
237
|
+
export {
|
|
238
|
+
fromReadable,
|
|
239
|
+
fromReadableChannel,
|
|
240
|
+
fromDuplex,
|
|
241
|
+
pipeThroughDuplex,
|
|
242
|
+
pipeThroughSimple,
|
|
243
|
+
toReadable,
|
|
244
|
+
toReadableNever,
|
|
245
|
+
toString,
|
|
246
|
+
toArrayBuffer,
|
|
247
|
+
toUint8Array,
|
|
248
|
+
NodeStream_exports
|
|
249
|
+
};
|