@fncts/node 0.0.45 → 0.0.46
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/_cjs/fs/api.cjs +25 -26
- package/_cjs/fs/api.cjs.map +1 -1
- package/_cjs/http/IncomingMessage.cjs +9 -10
- package/_cjs/http/IncomingMessage.cjs.map +1 -1
- package/_cjs/http/Server.cjs +25 -26
- package/_cjs/http/Server.cjs.map +1 -1
- package/_cjs/http/ServerRequest.cjs +4 -6
- package/_cjs/http/ServerRequest.cjs.map +1 -1
- package/_cjs/{chunk.cjs → rolldown-runtime.cjs} +2 -3
- package/_cjs/stream/api.cjs +26 -27
- package/_cjs/stream/api.cjs.map +1 -1
- package/_mjs/fs/api.mjs +2 -3
- package/_mjs/fs/api.mjs.map +1 -1
- package/_mjs/fs.mjs +1 -2
- package/_mjs/http/IncomingMessage.mjs +1 -2
- package/_mjs/http/IncomingMessage.mjs.map +1 -1
- package/_mjs/http/Server.mjs +1 -2
- package/_mjs/http/Server.mjs.map +1 -1
- package/_mjs/http/ServerRequest.mjs +2 -4
- package/_mjs/http/ServerRequest.mjs.map +1 -1
- package/_mjs/stream/api.mjs +1 -2
- package/_mjs/stream/api.mjs.map +1 -1
- package/_mjs/stream.mjs +1 -2
- package/package.json +3 -3
package/_mjs/stream/api.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.mjs","names":[],"sources":["../../esm/stream/api.js"],"sourcesContent":["const fileName_1 = \"(@fncts/node) src/stream/api.ts\";\nimport * as tsplus_module_1 from \"@fncts/io/Queue/constructors\";\nimport * as tsplus_module_2 from \"@fncts/io/IO/api\";\nimport * as tsplus_module_3 from \"@fncts/io/Queue/api/operations\";\nimport * as tsplus_module_4 from \"@fncts/io/Channel/api\";\nimport * as tsplus_module_5 from \"@fncts/base/data/Maybe/definition\";\nimport * as tsplus_module_6 from \"@fncts/base/data/Either/constructors\";\nimport * as tsplus_module_7 from \"@fncts/io/IO/runtime\";\nimport * as tsplus_module_8 from \"@fncts/base/data/Exit/constructors\";\nimport * as tsplus_module_9 from \"@fncts/io/Channel/core-api\";\nimport * as tsplus_module_10 from \"@fncts/base/data/Exit/api\";\nimport * as tsplus_module_11 from \"@fncts/base/data/Either/destructors\";\nimport * as tsplus_module_12 from \"@fncts/base/collection/immutable/Conc/definition\";\nimport * as tsplus_module_13 from \"@fncts/io/Sink/api\";\nimport * as tsplus_module_14 from \"@fncts/io/Future/api\";\nimport * as tsplus_module_15 from \"@fncts/io/Future/constructors\";\nimport * as tsplus_module_16 from \"@fncts/io/IO/api/asyncIO\";\nimport * as tsplus_module_17 from \"@fncts/io/IO/api/interrupt\";\nimport * as tsplus_module_18 from \"@fncts/base/collection/immutable/Conc/api\";\nimport * as tsplus_module_19 from \"@fncts/io/Sink/definition\";\nimport * as tsplus_module_20 from \"@fncts/io/IO/api/acquireRelease\";\nimport * as tsplus_module_21 from \"@fncts/io/Stream/api\";\nimport * as tsplus_module_22 from \"@fncts/base/collection/immutable/Conc/constructors\";\nimport * as tsplus_module_23 from \"@fncts/base/data/Maybe/constructors\";\nimport * as tsplus_module_24 from \"@fncts/io/IO/api/scoped\";\nimport { Stream } from \"@fncts/io/Stream\";\nexport class ReadableError {\n error;\n _tag = \"ReadableError\";\n constructor(error) {\n this.error = error;\n }\n}\nexport function fromReadable(readable, onError, chunkSize) {\n return new Stream(fromReadableChannel(readable, onError, chunkSize));\n}\nfunction fromReadableChannel(evaluate, onError, chunkSize) {\n return tsplus_module_4.acquireReleaseWith(tsplus_module_2.tap(([readable, queue]) => readableOffer(readable, queue, onError), fileName_1 + \":27:11\")(tsplus_module_2.zip(tsplus_module_1.makeUnbounded(fileName_1 + \":26:31\"), fileName_1 + \":26:11\")(tsplus_module_2.succeed(evaluate, fileName_1 + \":25:7\"))), ([readable, queue]) => readableTake(readable, queue, chunkSize), ([readable, queue]) => tsplus_module_2.zipRight(tsplus_module_3.shutdown(queue, fileName_1 + \":36:17\"), fileName_1 + \":36:11\")(tsplus_module_2.succeed(() => {\n // @ts-expect-error\n readable.removeAllListeners();\n if (\"closed\" in readable && !readable.closed) {\n readable.destroy();\n }\n }, fileName_1 + \":30:9\")));\n}\nfunction readableOffer(readable, queue, onError) {\n return tsplus_module_2.succeed(() => {\n // @ts-expect-error\n readable.on(\"readable\", () => {\n const size = tsplus_module_3.unsafeSize(queue, fileName_1 + \":48:25\");\n if (tsplus_module_5.isJust(size) && size.value <= 0) {\n tsplus_module_7.unsafeRun(tsplus_module_3.offer(tsplus_module_6.right(void 0, fileName_1 + \":50:33\"), fileName_1 + \":50:20\")(queue));\n }\n });\n // @ts-expect-error\n readable.on(\"error\", (err) => {\n tsplus_module_3.unsafeOffer(tsplus_module_6.left(tsplus_module_8.fail(onError(err), fileName_1 + \":55:46\"), fileName_1 + \":55:36\"), fileName_1 + \":55:24\")(queue);\n });\n // @ts-expect-error\n readable.on(\"end\", () => {\n tsplus_module_3.unsafeOffer(tsplus_module_6.left(tsplus_module_8.unit, fileName_1 + \":59:36\"), fileName_1 + \":59:24\")(queue);\n });\n if (readable.readable) {\n tsplus_module_3.unsafeOffer(tsplus_module_6.right(void 0, fileName_1 + \":62:37\"), fileName_1 + \":62:24\")(queue);\n }\n }, fileName_1 + \":45:12\");\n}\nfunction readableTake(readable, queue, chunkSize) {\n const read = readChunkChannel(readable, chunkSize);\n const loop = tsplus_module_9.flatMap((either) => tsplus_module_11.match((exit) => tsplus_module_10.match((cause) => tsplus_module_9.failCauseNow(cause), () => tsplus_module_4.unit)(exit), () => tsplus_module_9.flatMap(() => loop)(read))(either))(tsplus_module_4.fromIO(() => tsplus_module_3.take(queue, fileName_1 + \":73:100\")));\n return loop;\n}\nfunction readChunkChannel(readable, chunkSize) {\n return tsplus_module_4.defer(() => {\n const arr = [];\n let chunk = readable.read(chunkSize);\n while (chunk !== null) {\n arr.push(chunk);\n chunk = readable.read(chunkSize);\n }\n return tsplus_module_4.write(() => tsplus_module_12.fromArray(arr));\n });\n}\nexport function fromWritable(writable, onError, options) {\n return tsplus_module_13.fromChannel(fromWritableChannel(writable, onError, options), fileName_1 + \":109:26\");\n}\nexport function fromWritableChannel(writable, onError, options) {\n return tsplus_module_9.flatMap(([writable, future]) => tsplus_module_4.embedInput(writeInput(writable, (cause) => tsplus_module_14.failCause(cause, fileName_1 + \":119:62\")(future), options, tsplus_module_14.fulfill(tsplus_module_2.unit, fileName_1 + \":119:94\")(future)))(writableOutput(writable, future, onError)))(tsplus_module_4.fromIO(() => tsplus_module_2.zip(tsplus_module_15.make(fileName_1 + \":117:53\"), fileName_1 + \":117:41\")(tsplus_module_2.succeed(writable, fileName_1 + \":117:27\"))));\n}\nfunction writeInput(writable, onFailure, { encoding, endOnDone = true } = {}, onDone = tsplus_module_2.unit) {\n const write = writeIO(writable, encoding);\n const close = endOnDone\n ? tsplus_module_2.async((resume) => {\n if (\"closed\" in writable && writable.closed) {\n resume(tsplus_module_2.unit);\n }\n else {\n // @ts-expect-error\n writable.once(\"finish\", () => resume(tsplus_module_2.unit));\n }\n })\n : tsplus_module_2.unit;\n return {\n awaitRead: tsplus_module_2.unit,\n emit: write,\n error: (cause) => tsplus_module_2.zipRight(onFailure(cause), fileName_1 + \":145:30\")(close),\n done: (_) => tsplus_module_2.zipRight(onDone, fileName_1 + \":146:25\")(close),\n };\n}\nfunction writeIO(writable, encoding) {\n return (chunk) => {\n if (chunk.length === 0) {\n return tsplus_module_2.unit;\n }\n else {\n return tsplus_module_16.asyncIO((resume) => {\n const iterator = chunk[Symbol.iterator]();\n let done = false;\n let next = iterator.next();\n return tsplus_module_2.whileLoop(() => !done, () => {\n if (next.done) {\n return tsplus_module_2.succeed(() => {\n done = true;\n resume(tsplus_module_2.unit);\n }, fileName_1 + \":165:24\");\n }\n const success = writable.write(next.value, encoding);\n if (!success) {\n return tsplus_module_2.async((k) => {\n // @ts-expect-error\n writable.once(\"drain\", () => {\n k(tsplus_module_2.unit);\n });\n });\n }\n else {\n return tsplus_module_2.unit;\n }\n }, () => {\n next = iterator.next();\n });\n }, fileName_1 + \":155:24\");\n }\n };\n}\nfunction writableOutput(writable, future, onError) {\n return tsplus_module_4.fromIO(() => tsplus_module_2.defer(() => {\n function handleError(err) {\n tsplus_module_14.unsafeDone(tsplus_module_2.failNow(onError(err), fileName_1 + \":201:37\"), fileName_1 + \":201:26\")(future);\n }\n // @ts-expect-error\n writable.on(\"error\", handleError);\n // @ts-expect-error\n return tsplus_module_17.ensuring(tsplus_module_2.succeed(writable.removeListener(\"error\", handleError), fileName_1 + \":206:38\"), fileName_1 + \":206:35\")(tsplus_module_14.wait(future, fileName_1 + \":206:20\"));\n }, fileName_1 + \":199:13\"));\n}\nexport class TransformError {\n error;\n _tag = \"TransformError\";\n constructor(error) {\n this.error = error;\n }\n}\n/**\n * @tsplus pipeable fncts.io.Stream transform\n */\nexport function transform(transform) {\n return (self) => {\n const scopedSink = tsplus_module_2.map((transform) => {\n const endTransform = tsplus_module_2.succeed(() => transform.end(), fileName_1 + \":224:40\");\n const reader = tsplus_module_4.readWith((inp) => tsplus_module_4.unwrap(() => tsplus_module_2.async((cb) => {\n transform.write(tsplus_module_18.toBuffer(inp), (err) => {\n err ? cb(tsplus_module_2.failNow(new TransformError(err), fileName_1 + \":230:38\")) : tsplus_module_2.succeedNow(reader, fileName_1 + \":230:80\");\n });\n })), (err) => tsplus_module_4.unwrap(() => tsplus_module_2.map(() => tsplus_module_4.failNow(err), fileName_1 + \":234:51\")(endTransform)), () => tsplus_module_4.unwrap(() => tsplus_module_2.map(() => tsplus_module_4.unit, fileName_1 + \":235:48\")(endTransform)));\n return [transform, new tsplus_module_19.Sink(reader)];\n }, fileName_1 + \":223:11\")(tsplus_module_20.acquireRelease(() => tsplus_module_2.succeed(transform, fileName_1 + \":221:34\"), (transform) => tsplus_module_2.succeed(() => transform.destroy(), fileName_1 + \":222:48\"), fileName_1 + \":222:22\"));\n return tsplus_module_21.flatMap(([transform, sink]) => tsplus_module_21.ensuring(tsplus_module_2.succeed(() => transform.removeAllListeners(), fileName_1 + \":252:20\"), fileName_1 + \":252:17\")(tsplus_module_21.asyncIO((cb) => tsplus_module_2.zipRight(tsplus_module_21.run(sink, fileName_1 + \":251:29\")(self), fileName_1 + \":251:20\")(tsplus_module_2.succeed(() => {\n transform.on(\"data\", (chunk) => {\n cb(tsplus_module_2.succeed(() => tsplus_module_22.fromBuffer(chunk), fileName_1 + \":243:26\"));\n });\n transform.on(\"error\", (err) => {\n cb(tsplus_module_2.failNow(tsplus_module_23.just(new TransformError(err), fileName_1 + \":246:31\"), fileName_1 + \":246:26\"));\n });\n transform.on(\"end\", () => {\n cb(tsplus_module_2.failNow(tsplus_module_23.nothing(fileName_1 + \":249:34\"), fileName_1 + \":249:26\"));\n });\n }, fileName_1 + \":241:19\")))), fileName_1 + \":239:45\")(tsplus_module_21.scoped(() => scopedSink, fileName_1 + \":239:25\"));\n };\n}\nexport function toString(readable, onFailure, options) {\n const maxBytes = options?.maxBytes ? Number(options.maxBytes) : undefined;\n return tsplus_module_24.scoped(tsplus_module_2.flatMap((stream) => tsplus_module_2.async((resume) => {\n let string = \"\";\n let bytes = 0;\n // @ts-expect-error\n stream.once(\"error\", (err) => {\n resume(tsplus_module_2.failNow(onFailure(err), fileName_1 + \":286:28\"));\n });\n // @ts-expect-error\n stream.once(\"end\", () => {\n resume(tsplus_module_2.succeedNow(string, fileName_1 + \":290:31\"));\n });\n // @ts-expect-error\n stream.on(\"data\", (chunk) => {\n string += chunk;\n bytes += Buffer.byteLength(chunk);\n if (maxBytes && bytes > maxBytes) {\n resume(tsplus_module_2.failNow(onFailure(new Error(\"maxBytes exceeded\")), fileName_1 + \":297:30\"));\n }\n });\n }), fileName_1 + \":280:13\")(tsplus_module_20.acquireRelease(() => tsplus_module_2.succeed(() => {\n const stream = readable();\n stream.setEncoding(options?.encoding ?? \"utf8\");\n return stream;\n }, fileName_1 + \":266:12\"), (stream) => tsplus_module_2.succeed(() => {\n // @ts-expect-error\n stream.removeAllListeners();\n if (\"closed\" in stream && !stream.closed) {\n stream.destroy();\n }\n }, fileName_1 + \":272:9\"), fileName_1 + \":271:20\")), fileName_1 + \":301:6\");\n}\nexport function toUint8Array(readable, onFailure, options = {}) {\n const maxBytes = options.maxBytes ? Number(options.maxBytes) : undefined;\n return tsplus_module_24.scoped(tsplus_module_2.flatMap((stream) => tsplus_module_2.async((resume) => {\n let buffer = Buffer.alloc(0);\n let bytes = 0;\n // @ts-expect-error\n stream.once(\"error\", (err) => {\n resume(tsplus_module_2.failNow(onFailure(err), fileName_1 + \":328:28\"));\n });\n // @ts-expect-error\n stream.once(\"end\", () => {\n resume(tsplus_module_2.succeedNow(buffer, fileName_1 + \":332:31\"));\n });\n // @ts-expect-error\n stream.on(\"data\", (chunk) => {\n buffer = Buffer.concat([buffer, chunk]);\n bytes += chunk.length;\n if (maxBytes && bytes > maxBytes) {\n resume(tsplus_module_2.failNow(onFailure(new Error(\"maxBytes exceeded\")), fileName_1 + \":339:30\"));\n }\n });\n }), fileName_1 + \":322:13\")(tsplus_module_20.acquireRelease(() => tsplus_module_2.succeed(readable, fileName_1 + \":312:12\"), (stream) => tsplus_module_2.succeed(() => {\n // @ts-expect-error\n stream.removeAllListeners();\n if (\"closed\" in stream && !stream.closed) {\n stream.destroy();\n }\n }, fileName_1 + \":314:9\"), fileName_1 + \":313:20\")), fileName_1 + \":343:6\");\n}\n//# sourceMappingURL=api.js.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,aAAa;AA0BnB,IAAa,gBAAb,MAA2B;CACvB;CACA,OAAO;CACP,YAAY,OAAO;AACf,OAAK,QAAQ;;;AAGrB,SAAgB,aAAa,UAAU,SAAS,WAAW;AACvD,QAAO,IAAI,OAAO,oBAAoB,UAAU,SAAS,UAAU,CAAC;;AAExE,SAAS,oBAAoB,UAAU,SAAS,WAAW;AACvD,QAAO,gBAAgB,mBAAmB,gBAAgB,KAAK,CAAC,UAAU,WAAW,cAAc,UAAU,OAAO,QAAQ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,CAAC,OAAO,OAC9B,QAAO,SAAS;IAErB,aAAa,SAAS,EAAE,aAAa,UAAU,CAAC,EAAE,aAAa,SAAS;;AAE/E,SAAgB,aAAa,UAAU,WAAW,UAAU,EAAE,EAAE;CAC5D,MAAM,WAAW,QAAQ,WAAW,OAAO,QAAQ,SAAS,GAAG,KAAA;AAC/D,QAAO,iBAAiB,OAAO,gBAAgB,SAAS,WAAW,gBAAgB,OAAO,WAAW;EACjG,IAAI,SAAS,OAAO,MAAM,EAAE;EAC5B,IAAI,QAAQ;AAEZ,SAAO,KAAK,UAAU,QAAQ;AAC1B,UAAO,gBAAgB,QAAQ,UAAU,IAAI,EAAE,aAAa,UAAU,CAAC;IACzE;AAEF,SAAO,KAAK,aAAa;AACrB,UAAO,gBAAgB,WAAW,QAAQ,aAAa,UAAU,CAAC;IACpE;AAEF,SAAO,GAAG,SAAS,UAAU;AACzB,YAAS,OAAO,OAAO,CAAC,QAAQ,MAAM,CAAC;AACvC,YAAS,MAAM;AACf,OAAI,YAAY,QAAQ,SACpB,QAAO,gBAAgB,QAAQ,0BAAU,IAAI,MAAM,oBAAoB,CAAC,EAAE,aAAa,UAAU,CAAC;IAExG;GACJ,EAAE,aAAa,UAAU,CAAC,iBAAiB,qBAAqB,gBAAgB,QAAQ,UAAU,aAAa,UAAU,GAAG,WAAW,gBAAgB,cAAc;AAEnK,SAAO,oBAAoB;AAC3B,MAAI,YAAY,UAAU,CAAC,OAAO,OAC9B,QAAO,SAAS;IAErB,aAAa,SAAS,EAAE,aAAa,UAAU,CAAC,EAAE,aAAa,SAAS"}
|
|
1
|
+
{"version":3,"file":"api.mjs","names":[],"sources":["../../esm/stream/api.js"],"sourcesContent":["const fileName_1 = \"(@fncts/node) src/stream/api.ts\";\nimport * as tsplus_module_1 from \"@fncts/io/Queue/constructors\";\nimport * as tsplus_module_2 from \"@fncts/io/IO/api\";\nimport * as tsplus_module_3 from \"@fncts/io/Queue/api/operations\";\nimport * as tsplus_module_4 from \"@fncts/io/Channel/api\";\nimport * as tsplus_module_5 from \"@fncts/base/data/Maybe/definition\";\nimport * as tsplus_module_6 from \"@fncts/base/data/Either/constructors\";\nimport * as tsplus_module_7 from \"@fncts/io/IO/runtime\";\nimport * as tsplus_module_8 from \"@fncts/base/data/Exit/constructors\";\nimport * as tsplus_module_9 from \"@fncts/io/Channel/core-api\";\nimport * as tsplus_module_10 from \"@fncts/base/data/Exit/api\";\nimport * as tsplus_module_11 from \"@fncts/base/data/Either/destructors\";\nimport * as tsplus_module_12 from \"@fncts/base/collection/immutable/Conc/definition\";\nimport * as tsplus_module_13 from \"@fncts/io/Sink/api\";\nimport * as tsplus_module_14 from \"@fncts/io/Future/api\";\nimport * as tsplus_module_15 from \"@fncts/io/Future/constructors\";\nimport * as tsplus_module_16 from \"@fncts/io/IO/api/asyncIO\";\nimport * as tsplus_module_17 from \"@fncts/io/IO/api/interrupt\";\nimport * as tsplus_module_18 from \"@fncts/base/collection/immutable/Conc/api\";\nimport * as tsplus_module_19 from \"@fncts/io/Sink/definition\";\nimport * as tsplus_module_20 from \"@fncts/io/IO/api/acquireRelease\";\nimport * as tsplus_module_21 from \"@fncts/io/Stream/api\";\nimport * as tsplus_module_22 from \"@fncts/base/collection/immutable/Conc/constructors\";\nimport * as tsplus_module_23 from \"@fncts/base/data/Maybe/constructors\";\nimport * as tsplus_module_24 from \"@fncts/io/IO/api/scoped\";\nimport { Stream } from \"@fncts/io/Stream\";\nexport class ReadableError {\n error;\n _tag = \"ReadableError\";\n constructor(error) {\n this.error = error;\n }\n}\nexport function fromReadable(readable, onError, chunkSize) {\n return new Stream(fromReadableChannel(readable, onError, chunkSize));\n}\nfunction fromReadableChannel(evaluate, onError, chunkSize) {\n return tsplus_module_4.acquireReleaseWith(tsplus_module_2.tap(([readable, queue]) => readableOffer(readable, queue, onError), fileName_1 + \":27:11\")(tsplus_module_2.zip(tsplus_module_1.makeUnbounded(fileName_1 + \":26:31\"), fileName_1 + \":26:11\")(tsplus_module_2.succeed(evaluate, fileName_1 + \":25:7\"))), ([readable, queue]) => readableTake(readable, queue, chunkSize), ([readable, queue]) => tsplus_module_2.zipRight(tsplus_module_3.shutdown(queue, fileName_1 + \":36:17\"), fileName_1 + \":36:11\")(tsplus_module_2.succeed(() => {\n // @ts-expect-error\n readable.removeAllListeners();\n if (\"closed\" in readable && !readable.closed) {\n readable.destroy();\n }\n }, fileName_1 + \":30:9\")));\n}\nfunction readableOffer(readable, queue, onError) {\n return tsplus_module_2.succeed(() => {\n // @ts-expect-error\n readable.on(\"readable\", () => {\n const size = tsplus_module_3.unsafeSize(queue, fileName_1 + \":48:25\");\n if (tsplus_module_5.isJust(size) && size.value <= 0) {\n tsplus_module_7.unsafeRun(tsplus_module_3.offer(tsplus_module_6.right(void 0, fileName_1 + \":50:33\"), fileName_1 + \":50:20\")(queue));\n }\n });\n // @ts-expect-error\n readable.on(\"error\", (err) => {\n tsplus_module_3.unsafeOffer(tsplus_module_6.left(tsplus_module_8.fail(onError(err), fileName_1 + \":55:46\"), fileName_1 + \":55:36\"), fileName_1 + \":55:24\")(queue);\n });\n // @ts-expect-error\n readable.on(\"end\", () => {\n tsplus_module_3.unsafeOffer(tsplus_module_6.left(tsplus_module_8.unit, fileName_1 + \":59:36\"), fileName_1 + \":59:24\")(queue);\n });\n if (readable.readable) {\n tsplus_module_3.unsafeOffer(tsplus_module_6.right(void 0, fileName_1 + \":62:37\"), fileName_1 + \":62:24\")(queue);\n }\n }, fileName_1 + \":45:12\");\n}\nfunction readableTake(readable, queue, chunkSize) {\n const read = readChunkChannel(readable, chunkSize);\n const loop = tsplus_module_9.flatMap((either) => tsplus_module_11.match((exit) => tsplus_module_10.match((cause) => tsplus_module_9.failCauseNow(cause), () => tsplus_module_4.unit)(exit), () => tsplus_module_9.flatMap(() => loop)(read))(either))(tsplus_module_4.fromIO(() => tsplus_module_3.take(queue, fileName_1 + \":73:100\")));\n return loop;\n}\nfunction readChunkChannel(readable, chunkSize) {\n return tsplus_module_4.defer(() => {\n const arr = [];\n let chunk = readable.read(chunkSize);\n while (chunk !== null) {\n arr.push(chunk);\n chunk = readable.read(chunkSize);\n }\n return tsplus_module_4.write(() => tsplus_module_12.fromArray(arr));\n });\n}\nexport function fromWritable(writable, onError, options) {\n return tsplus_module_13.fromChannel(fromWritableChannel(writable, onError, options), fileName_1 + \":109:26\");\n}\nexport function fromWritableChannel(writable, onError, options) {\n return tsplus_module_9.flatMap(([writable, future]) => tsplus_module_4.embedInput(writeInput(writable, (cause) => tsplus_module_14.failCause(cause, fileName_1 + \":119:62\")(future), options, tsplus_module_14.fulfill(tsplus_module_2.unit, fileName_1 + \":119:94\")(future)))(writableOutput(writable, future, onError)))(tsplus_module_4.fromIO(() => tsplus_module_2.zip(tsplus_module_15.make(fileName_1 + \":117:53\"), fileName_1 + \":117:41\")(tsplus_module_2.succeed(writable, fileName_1 + \":117:27\"))));\n}\nfunction writeInput(writable, onFailure, { encoding, endOnDone = true } = {}, onDone = tsplus_module_2.unit) {\n const write = writeIO(writable, encoding);\n const close = endOnDone\n ? tsplus_module_2.async((resume) => {\n if (\"closed\" in writable && writable.closed) {\n resume(tsplus_module_2.unit);\n }\n else {\n // @ts-expect-error\n writable.once(\"finish\", () => resume(tsplus_module_2.unit));\n }\n })\n : tsplus_module_2.unit;\n return {\n awaitRead: tsplus_module_2.unit,\n emit: write,\n error: (cause) => tsplus_module_2.zipRight(onFailure(cause), fileName_1 + \":145:30\")(close),\n done: (_) => tsplus_module_2.zipRight(onDone, fileName_1 + \":146:25\")(close),\n };\n}\nfunction writeIO(writable, encoding) {\n return (chunk) => {\n if (chunk.length === 0) {\n return tsplus_module_2.unit;\n }\n else {\n return tsplus_module_16.asyncIO((resume) => {\n const iterator = chunk[Symbol.iterator]();\n let done = false;\n let next = iterator.next();\n return tsplus_module_2.whileLoop(() => !done, () => {\n if (next.done) {\n return tsplus_module_2.succeed(() => {\n done = true;\n resume(tsplus_module_2.unit);\n }, fileName_1 + \":165:24\");\n }\n const success = writable.write(next.value, encoding);\n if (!success) {\n return tsplus_module_2.async((k) => {\n // @ts-expect-error\n writable.once(\"drain\", () => {\n k(tsplus_module_2.unit);\n });\n });\n }\n else {\n return tsplus_module_2.unit;\n }\n }, () => {\n next = iterator.next();\n });\n }, fileName_1 + \":155:24\");\n }\n };\n}\nfunction writableOutput(writable, future, onError) {\n return tsplus_module_4.fromIO(() => tsplus_module_2.defer(() => {\n function handleError(err) {\n tsplus_module_14.unsafeDone(tsplus_module_2.failNow(onError(err), fileName_1 + \":201:37\"), fileName_1 + \":201:26\")(future);\n }\n // @ts-expect-error\n writable.on(\"error\", handleError);\n // @ts-expect-error\n return tsplus_module_17.ensuring(tsplus_module_2.succeed(writable.removeListener(\"error\", handleError), fileName_1 + \":206:38\"), fileName_1 + \":206:35\")(tsplus_module_14.wait(future, fileName_1 + \":206:20\"));\n }, fileName_1 + \":199:13\"));\n}\nexport class TransformError {\n error;\n _tag = \"TransformError\";\n constructor(error) {\n this.error = error;\n }\n}\n/**\n * @tsplus pipeable fncts.io.Stream transform\n */\nexport function transform(transform) {\n return (self) => {\n const scopedSink = tsplus_module_2.map((transform) => {\n const endTransform = tsplus_module_2.succeed(() => transform.end(), fileName_1 + \":224:40\");\n const reader = tsplus_module_4.readWith((inp) => tsplus_module_4.unwrap(() => tsplus_module_2.async((cb) => {\n transform.write(tsplus_module_18.toBuffer(inp), (err) => {\n err ? cb(tsplus_module_2.failNow(new TransformError(err), fileName_1 + \":230:38\")) : tsplus_module_2.succeedNow(reader, fileName_1 + \":230:80\");\n });\n })), (err) => tsplus_module_4.unwrap(() => tsplus_module_2.map(() => tsplus_module_4.failNow(err), fileName_1 + \":234:51\")(endTransform)), () => tsplus_module_4.unwrap(() => tsplus_module_2.map(() => tsplus_module_4.unit, fileName_1 + \":235:48\")(endTransform)));\n return [transform, new tsplus_module_19.Sink(reader)];\n }, fileName_1 + \":223:11\")(tsplus_module_20.acquireRelease(() => tsplus_module_2.succeed(transform, fileName_1 + \":221:34\"), (transform) => tsplus_module_2.succeed(() => transform.destroy(), fileName_1 + \":222:48\"), fileName_1 + \":222:22\"));\n return tsplus_module_21.flatMap(([transform, sink]) => tsplus_module_21.ensuring(tsplus_module_2.succeed(() => transform.removeAllListeners(), fileName_1 + \":252:20\"), fileName_1 + \":252:17\")(tsplus_module_21.asyncIO((cb) => tsplus_module_2.zipRight(tsplus_module_21.run(sink, fileName_1 + \":251:29\")(self), fileName_1 + \":251:20\")(tsplus_module_2.succeed(() => {\n transform.on(\"data\", (chunk) => {\n cb(tsplus_module_2.succeed(() => tsplus_module_22.fromBuffer(chunk), fileName_1 + \":243:26\"));\n });\n transform.on(\"error\", (err) => {\n cb(tsplus_module_2.failNow(tsplus_module_23.just(new TransformError(err), fileName_1 + \":246:31\"), fileName_1 + \":246:26\"));\n });\n transform.on(\"end\", () => {\n cb(tsplus_module_2.failNow(tsplus_module_23.nothing(fileName_1 + \":249:34\"), fileName_1 + \":249:26\"));\n });\n }, fileName_1 + \":241:19\")))), fileName_1 + \":239:45\")(tsplus_module_21.scoped(() => scopedSink, fileName_1 + \":239:25\"));\n };\n}\nexport function toString(readable, onFailure, options) {\n const maxBytes = options?.maxBytes ? Number(options.maxBytes) : undefined;\n return tsplus_module_24.scoped(tsplus_module_2.flatMap((stream) => tsplus_module_2.async((resume) => {\n let string = \"\";\n let bytes = 0;\n // @ts-expect-error\n stream.once(\"error\", (err) => {\n resume(tsplus_module_2.failNow(onFailure(err), fileName_1 + \":286:28\"));\n });\n // @ts-expect-error\n stream.once(\"end\", () => {\n resume(tsplus_module_2.succeedNow(string, fileName_1 + \":290:31\"));\n });\n // @ts-expect-error\n stream.on(\"data\", (chunk) => {\n string += chunk;\n bytes += Buffer.byteLength(chunk);\n if (maxBytes && bytes > maxBytes) {\n resume(tsplus_module_2.failNow(onFailure(new Error(\"maxBytes exceeded\")), fileName_1 + \":297:30\"));\n }\n });\n }), fileName_1 + \":280:13\")(tsplus_module_20.acquireRelease(() => tsplus_module_2.succeed(() => {\n const stream = readable();\n stream.setEncoding(options?.encoding ?? \"utf8\");\n return stream;\n }, fileName_1 + \":266:12\"), (stream) => tsplus_module_2.succeed(() => {\n // @ts-expect-error\n stream.removeAllListeners();\n if (\"closed\" in stream && !stream.closed) {\n stream.destroy();\n }\n }, fileName_1 + \":272:9\"), fileName_1 + \":271:20\")), fileName_1 + \":301:6\");\n}\nexport function toUint8Array(readable, onFailure, options = {}) {\n const maxBytes = options.maxBytes ? Number(options.maxBytes) : undefined;\n return tsplus_module_24.scoped(tsplus_module_2.flatMap((stream) => tsplus_module_2.async((resume) => {\n let buffer = Buffer.alloc(0);\n let bytes = 0;\n // @ts-expect-error\n stream.once(\"error\", (err) => {\n resume(tsplus_module_2.failNow(onFailure(err), fileName_1 + \":328:28\"));\n });\n // @ts-expect-error\n stream.once(\"end\", () => {\n resume(tsplus_module_2.succeedNow(buffer, fileName_1 + \":332:31\"));\n });\n // @ts-expect-error\n stream.on(\"data\", (chunk) => {\n buffer = Buffer.concat([buffer, chunk]);\n bytes += chunk.length;\n if (maxBytes && bytes > maxBytes) {\n resume(tsplus_module_2.failNow(onFailure(new Error(\"maxBytes exceeded\")), fileName_1 + \":339:30\"));\n }\n });\n }), fileName_1 + \":322:13\")(tsplus_module_20.acquireRelease(() => tsplus_module_2.succeed(readable, fileName_1 + \":312:12\"), (stream) => tsplus_module_2.succeed(() => {\n // @ts-expect-error\n stream.removeAllListeners();\n if (\"closed\" in stream && !stream.closed) {\n stream.destroy();\n }\n }, fileName_1 + \":314:9\"), fileName_1 + \":313:20\")), fileName_1 + \":343:6\");\n}\n//# sourceMappingURL=api.js.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,aAAa;AA0BnB,IAAa,gBAAb,MAA2B;CACvB;CACA,OAAO;CACP,YAAY,OAAO;EACf,KAAK,QAAQ;CACjB;AACJ;AACA,SAAgB,aAAa,UAAU,SAAS,WAAW;CACvD,OAAO,IAAI,OAAO,oBAAoB,UAAU,SAAS,SAAS,CAA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I,MAAM,mBAAmB,CAAC,GAAG,aAAa,SAAS,CAAC;EAEzG,CAAC;CACL,CAAC,GAAG,aAAa,SAAS,CAAC,CAAC,iBAAiB,qBAAqB,gBAAgB,QAAQ,UAAU,aAAa,SAAS,IAAI,WAAW,gBAAgB,cAAc;EAEnK,OAAO,mBAAmB;EAC1B,IAAI,YAAY,UAAU,CAAC,OAAO,QAC9B,OAAO,QAAQ;CAEvB,GAAG,aAAa,QAAQ,GAAG,aAAa,SAAS,CAAC,GAAG,aAAa,QAAQ;AAC9E"}
|
package/_mjs/stream.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { ReadableError, TransformError, fromReadable, fromWritable, fromWritableChannel, toString, toUint8Array, transform };
|
|
1
|
+
export { ReadableError, TransformError, fromReadable, fromWritable, fromWritableChannel, toString, toUint8Array, transform } from "./stream/api.mjs";
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fncts/node",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.46",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/0x706b/fncts"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"ws": "^8.
|
|
10
|
-
"@fncts/io": "0.0.
|
|
9
|
+
"ws": "^8.22.0",
|
|
10
|
+
"@fncts/io": "0.0.53"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
"./*": {
|