@effect/platform-node-shared
Advanced tools
Comparing version 0.0.0-snapshot-28c950c1f2b091132e985b78bbb8d0f72c86ce2f to 0.0.0-snapshot-3877d62208e83aededdf0b98c4c49b814f4d7da6
@@ -7,42 +7,19 @@ "use strict"; | ||
exports.layer = void 0; | ||
var Command = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/Command")); | ||
var CommandExecutor = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/CommandExecutor")); | ||
var FileSystem = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/FileSystem")); | ||
var Deferred = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Deferred")); | ||
var Effect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Effect")); | ||
var _Function = /*#__PURE__*/require("effect/Function"); | ||
var Inspectable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Inspectable")); | ||
var Layer = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Layer")); | ||
var Option = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Option")); | ||
var Sink = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Sink")); | ||
var Stream = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Stream")); | ||
var ChildProcess = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("node:child_process")); | ||
var _error = /*#__PURE__*/require("./error.js"); | ||
var _sink = /*#__PURE__*/require("./sink.js"); | ||
var _stream = /*#__PURE__*/require("./stream.js"); | ||
function _getRequireWildcardCache(e) { | ||
if ("function" != typeof WeakMap) return null; | ||
var r = new WeakMap(), | ||
t = new WeakMap(); | ||
return (_getRequireWildcardCache = function (e) { | ||
return e ? t : r; | ||
})(e); | ||
} | ||
function _interopRequireWildcard(e, r) { | ||
if (!r && e && e.__esModule) return e; | ||
if (null === e || "object" != typeof e && "function" != typeof e) return { | ||
default: e | ||
}; | ||
var t = _getRequireWildcardCache(r); | ||
if (t && t.has(e)) return t.get(e); | ||
var n = { | ||
__proto__: null | ||
}, | ||
a = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { | ||
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; | ||
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; | ||
} | ||
return n.default = e, t && t.set(e, n), n; | ||
} | ||
var Command = _interopRequireWildcard(require("@effect/platform/Command")); | ||
var CommandExecutor = _interopRequireWildcard(require("@effect/platform/CommandExecutor")); | ||
var FileSystem = _interopRequireWildcard(require("@effect/platform/FileSystem")); | ||
var Deferred = _interopRequireWildcard(require("effect/Deferred")); | ||
var Effect = _interopRequireWildcard(require("effect/Effect")); | ||
var _Function = require("effect/Function"); | ||
var Inspectable = _interopRequireWildcard(require("effect/Inspectable")); | ||
var Layer = _interopRequireWildcard(require("effect/Layer")); | ||
var Option = _interopRequireWildcard(require("effect/Option")); | ||
var Sink = _interopRequireWildcard(require("effect/Sink")); | ||
var Stream = _interopRequireWildcard(require("effect/Stream")); | ||
var ChildProcess = _interopRequireWildcard(require("node:child_process")); | ||
var _error = require("./error.js"); | ||
var _sink = require("./sink.js"); | ||
var _stream = require("./stream.js"); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
const inputToStdioOption = stdin => typeof stdin === "string" ? stdin : "pipe"; | ||
@@ -49,0 +26,0 @@ const outputToStdioOption = output => typeof output === "string" ? output : "pipe"; |
@@ -7,3 +7,3 @@ "use strict"; | ||
exports.handleErrnoException = void 0; | ||
var _Error = /*#__PURE__*/require("@effect/platform/Error"); | ||
var _Error = require("@effect/platform/Error"); | ||
/** @internal */ | ||
@@ -10,0 +10,0 @@ const handleErrnoException = (module, method) => (err, [path]) => { |
@@ -7,40 +7,17 @@ "use strict"; | ||
exports.layer = void 0; | ||
var _Effectify = /*#__PURE__*/require("@effect/platform/Effectify"); | ||
var Error = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/Error")); | ||
var FileSystem = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/FileSystem")); | ||
var Effect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Effect")); | ||
var _Function = /*#__PURE__*/require("effect/Function"); | ||
var Layer = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Layer")); | ||
var Option = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Option")); | ||
var Stream = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Stream")); | ||
var Crypto = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("node:crypto")); | ||
var NFS = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("node:fs")); | ||
var OS = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("node:os")); | ||
var Path = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("node:path")); | ||
var _error = /*#__PURE__*/require("./error.js"); | ||
function _getRequireWildcardCache(e) { | ||
if ("function" != typeof WeakMap) return null; | ||
var r = new WeakMap(), | ||
t = new WeakMap(); | ||
return (_getRequireWildcardCache = function (e) { | ||
return e ? t : r; | ||
})(e); | ||
} | ||
function _interopRequireWildcard(e, r) { | ||
if (!r && e && e.__esModule) return e; | ||
if (null === e || "object" != typeof e && "function" != typeof e) return { | ||
default: e | ||
}; | ||
var t = _getRequireWildcardCache(r); | ||
if (t && t.has(e)) return t.get(e); | ||
var n = { | ||
__proto__: null | ||
}, | ||
a = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { | ||
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; | ||
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; | ||
} | ||
return n.default = e, t && t.set(e, n), n; | ||
} | ||
var _Effectify = require("@effect/platform/Effectify"); | ||
var Error = _interopRequireWildcard(require("@effect/platform/Error")); | ||
var FileSystem = _interopRequireWildcard(require("@effect/platform/FileSystem")); | ||
var Effect = _interopRequireWildcard(require("effect/Effect")); | ||
var _Function = require("effect/Function"); | ||
var Layer = _interopRequireWildcard(require("effect/Layer")); | ||
var Option = _interopRequireWildcard(require("effect/Option")); | ||
var Stream = _interopRequireWildcard(require("effect/Stream")); | ||
var Crypto = _interopRequireWildcard(require("node:crypto")); | ||
var NFS = _interopRequireWildcard(require("node:fs")); | ||
var OS = _interopRequireWildcard(require("node:os")); | ||
var Path = _interopRequireWildcard(require("node:path")); | ||
var _error = require("./error.js"); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
const handleBadArgument = method => err => Error.BadArgument({ | ||
@@ -47,0 +24,0 @@ module: "FileSystem", |
@@ -7,35 +7,12 @@ "use strict"; | ||
exports.layer = void 0; | ||
var Error = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/Error")); | ||
var FileSystem = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/FileSystem")); | ||
var ParcelWatcher = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@parcel/watcher")); | ||
var Chunk = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Chunk")); | ||
var Effect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Effect")); | ||
var Layer = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Layer")); | ||
var Option = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Option")); | ||
var Stream = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Stream")); | ||
function _getRequireWildcardCache(e) { | ||
if ("function" != typeof WeakMap) return null; | ||
var r = new WeakMap(), | ||
t = new WeakMap(); | ||
return (_getRequireWildcardCache = function (e) { | ||
return e ? t : r; | ||
})(e); | ||
} | ||
function _interopRequireWildcard(e, r) { | ||
if (!r && e && e.__esModule) return e; | ||
if (null === e || "object" != typeof e && "function" != typeof e) return { | ||
default: e | ||
}; | ||
var t = _getRequireWildcardCache(r); | ||
if (t && t.has(e)) return t.get(e); | ||
var n = { | ||
__proto__: null | ||
}, | ||
a = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { | ||
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; | ||
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; | ||
} | ||
return n.default = e, t && t.set(e, n), n; | ||
} | ||
var Error = _interopRequireWildcard(require("@effect/platform/Error")); | ||
var FileSystem = _interopRequireWildcard(require("@effect/platform/FileSystem")); | ||
var ParcelWatcher = _interopRequireWildcard(require("@parcel/watcher")); | ||
var Chunk = _interopRequireWildcard(require("effect/Chunk")); | ||
var Effect = _interopRequireWildcard(require("effect/Effect")); | ||
var Layer = _interopRequireWildcard(require("effect/Layer")); | ||
var Option = _interopRequireWildcard(require("effect/Option")); | ||
var Stream = _interopRequireWildcard(require("effect/Stream")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
const watchParcel = path => Stream.asyncScoped(emit => Effect.acquireRelease(Effect.tryPromise({ | ||
@@ -42,0 +19,0 @@ try: () => ParcelWatcher.subscribe(path, (error, events) => { |
@@ -7,33 +7,10 @@ "use strict"; | ||
exports.layerWin32 = exports.layerPosix = exports.layer = void 0; | ||
var _Error = /*#__PURE__*/require("@effect/platform/Error"); | ||
var _Path = /*#__PURE__*/require("@effect/platform/Path"); | ||
var Effect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Effect")); | ||
var Layer = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Layer")); | ||
var NodePath = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("node:path")); | ||
var NodeUrl = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("node:url")); | ||
function _getRequireWildcardCache(e) { | ||
if ("function" != typeof WeakMap) return null; | ||
var r = new WeakMap(), | ||
t = new WeakMap(); | ||
return (_getRequireWildcardCache = function (e) { | ||
return e ? t : r; | ||
})(e); | ||
} | ||
function _interopRequireWildcard(e, r) { | ||
if (!r && e && e.__esModule) return e; | ||
if (null === e || "object" != typeof e && "function" != typeof e) return { | ||
default: e | ||
}; | ||
var t = _getRequireWildcardCache(r); | ||
if (t && t.has(e)) return t.get(e); | ||
var n = { | ||
__proto__: null | ||
}, | ||
a = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { | ||
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; | ||
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; | ||
} | ||
return n.default = e, t && t.set(e, n), n; | ||
} | ||
var _Error = require("@effect/platform/Error"); | ||
var _Path = require("@effect/platform/Path"); | ||
var Effect = _interopRequireWildcard(require("effect/Effect")); | ||
var Layer = _interopRequireWildcard(require("effect/Layer")); | ||
var NodePath = _interopRequireWildcard(require("node:path")); | ||
var NodeUrl = _interopRequireWildcard(require("node:url")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
const fromFileUrl = url => Effect.try({ | ||
@@ -40,0 +17,0 @@ try: () => NodeUrl.fileURLToPath(url), |
@@ -7,30 +7,7 @@ "use strict"; | ||
exports.runMain = void 0; | ||
var _Runtime = /*#__PURE__*/require("@effect/platform/Runtime"); | ||
var Cause = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Cause")); | ||
var Effect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Effect")); | ||
function _getRequireWildcardCache(e) { | ||
if ("function" != typeof WeakMap) return null; | ||
var r = new WeakMap(), | ||
t = new WeakMap(); | ||
return (_getRequireWildcardCache = function (e) { | ||
return e ? t : r; | ||
})(e); | ||
} | ||
function _interopRequireWildcard(e, r) { | ||
if (!r && e && e.__esModule) return e; | ||
if (null === e || "object" != typeof e && "function" != typeof e) return { | ||
default: e | ||
}; | ||
var t = _getRequireWildcardCache(r); | ||
if (t && t.has(e)) return t.get(e); | ||
var n = { | ||
__proto__: null | ||
}, | ||
a = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { | ||
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; | ||
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; | ||
} | ||
return n.default = e, t && t.set(e, n), n; | ||
} | ||
var _Runtime = require("@effect/platform/Runtime"); | ||
var Cause = _interopRequireWildcard(require("effect/Cause")); | ||
var Effect = _interopRequireWildcard(require("effect/Effect")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
/** @internal */ | ||
@@ -37,0 +14,0 @@ const runMain = (effect, options) => { |
@@ -7,32 +7,9 @@ "use strict"; | ||
exports.fromWritableChannel = exports.fromWritable = void 0; | ||
var Channel = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Channel")); | ||
var Deferred = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Deferred")); | ||
var Effect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Effect")); | ||
var Sink = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Sink")); | ||
var _stream = /*#__PURE__*/require("./stream.js"); | ||
function _getRequireWildcardCache(e) { | ||
if ("function" != typeof WeakMap) return null; | ||
var r = new WeakMap(), | ||
t = new WeakMap(); | ||
return (_getRequireWildcardCache = function (e) { | ||
return e ? t : r; | ||
})(e); | ||
} | ||
function _interopRequireWildcard(e, r) { | ||
if (!r && e && e.__esModule) return e; | ||
if (null === e || "object" != typeof e && "function" != typeof e) return { | ||
default: e | ||
}; | ||
var t = _getRequireWildcardCache(r); | ||
if (t && t.has(e)) return t.get(e); | ||
var n = { | ||
__proto__: null | ||
}, | ||
a = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { | ||
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; | ||
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; | ||
} | ||
return n.default = e, t && t.set(e, n), n; | ||
} | ||
var Channel = _interopRequireWildcard(require("effect/Channel")); | ||
var Deferred = _interopRequireWildcard(require("effect/Deferred")); | ||
var Effect = _interopRequireWildcard(require("effect/Effect")); | ||
var Sink = _interopRequireWildcard(require("effect/Sink")); | ||
var _stream = require("./stream.js"); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
/** @internal */ | ||
@@ -39,0 +16,0 @@ const fromWritable = (evaluate, onError, options) => Sink.fromChannel(fromWritableChannel(evaluate, onError, options)); |
@@ -7,40 +7,17 @@ "use strict"; | ||
exports.writeInput = exports.writeEffect = exports.toUint8Array = exports.toString = exports.toReadableNever = exports.toReadable = exports.pipeThroughSimple = exports.pipeThroughDuplex = exports.fromReadableChannel = exports.fromReadable = exports.fromDuplex = void 0; | ||
var _Error = /*#__PURE__*/require("@effect/platform/Error"); | ||
var Cause = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Cause")); | ||
var Channel = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Channel")); | ||
var Chunk = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Chunk")); | ||
var Effect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Effect")); | ||
var Either = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Either")); | ||
var Exit = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Exit")); | ||
var _Function = /*#__PURE__*/require("effect/Function"); | ||
var Queue = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Queue")); | ||
var Runtime = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Runtime")); | ||
var Scope = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Scope")); | ||
var Stream = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Stream")); | ||
var _nodeStream = /*#__PURE__*/require("node:stream"); | ||
function _getRequireWildcardCache(e) { | ||
if ("function" != typeof WeakMap) return null; | ||
var r = new WeakMap(), | ||
t = new WeakMap(); | ||
return (_getRequireWildcardCache = function (e) { | ||
return e ? t : r; | ||
})(e); | ||
} | ||
function _interopRequireWildcard(e, r) { | ||
if (!r && e && e.__esModule) return e; | ||
if (null === e || "object" != typeof e && "function" != typeof e) return { | ||
default: e | ||
}; | ||
var t = _getRequireWildcardCache(r); | ||
if (t && t.has(e)) return t.get(e); | ||
var n = { | ||
__proto__: null | ||
}, | ||
a = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { | ||
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; | ||
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; | ||
} | ||
return n.default = e, t && t.set(e, n), n; | ||
} | ||
var _Error = require("@effect/platform/Error"); | ||
var Cause = _interopRequireWildcard(require("effect/Cause")); | ||
var Channel = _interopRequireWildcard(require("effect/Channel")); | ||
var Chunk = _interopRequireWildcard(require("effect/Chunk")); | ||
var Effect = _interopRequireWildcard(require("effect/Effect")); | ||
var Either = _interopRequireWildcard(require("effect/Either")); | ||
var Exit = _interopRequireWildcard(require("effect/Exit")); | ||
var _Function = require("effect/Function"); | ||
var Queue = _interopRequireWildcard(require("effect/Queue")); | ||
var Runtime = _interopRequireWildcard(require("effect/Runtime")); | ||
var Scope = _interopRequireWildcard(require("effect/Scope")); | ||
var Stream = _interopRequireWildcard(require("effect/Stream")); | ||
var _nodeStream = require("node:stream"); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
/** @internal */ | ||
@@ -47,0 +24,0 @@ const fromReadable = (evaluate, onError, { |
@@ -7,33 +7,10 @@ "use strict"; | ||
exports.make = exports.layer = void 0; | ||
var Error = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/Error")); | ||
var Terminal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/Terminal")); | ||
var Effect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Effect")); | ||
var Layer = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Layer")); | ||
var Option = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Option")); | ||
var readline = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("node:readline")); | ||
function _getRequireWildcardCache(e) { | ||
if ("function" != typeof WeakMap) return null; | ||
var r = new WeakMap(), | ||
t = new WeakMap(); | ||
return (_getRequireWildcardCache = function (e) { | ||
return e ? t : r; | ||
})(e); | ||
} | ||
function _interopRequireWildcard(e, r) { | ||
if (!r && e && e.__esModule) return e; | ||
if (null === e || "object" != typeof e && "function" != typeof e) return { | ||
default: e | ||
}; | ||
var t = _getRequireWildcardCache(r); | ||
if (t && t.has(e)) return t.get(e); | ||
var n = { | ||
__proto__: null | ||
}, | ||
a = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { | ||
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; | ||
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; | ||
} | ||
return n.default = e, t && t.set(e, n), n; | ||
} | ||
var Error = _interopRequireWildcard(require("@effect/platform/Error")); | ||
var Terminal = _interopRequireWildcard(require("@effect/platform/Terminal")); | ||
var Effect = _interopRequireWildcard(require("effect/Effect")); | ||
var Layer = _interopRequireWildcard(require("effect/Layer")); | ||
var Option = _interopRequireWildcard(require("effect/Option")); | ||
var readline = _interopRequireWildcard(require("node:readline")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
const defaultShouldQuit = input => input.key.ctrl && (input.key.name === "c" || input.key.name === "d"); | ||
@@ -40,0 +17,0 @@ /** @internal */ |
@@ -7,28 +7,5 @@ "use strict"; | ||
exports.layer = void 0; | ||
var internal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/commandExecutor.js")); | ||
function _getRequireWildcardCache(e) { | ||
if ("function" != typeof WeakMap) return null; | ||
var r = new WeakMap(), | ||
t = new WeakMap(); | ||
return (_getRequireWildcardCache = function (e) { | ||
return e ? t : r; | ||
})(e); | ||
} | ||
function _interopRequireWildcard(e, r) { | ||
if (!r && e && e.__esModule) return e; | ||
if (null === e || "object" != typeof e && "function" != typeof e) return { | ||
default: e | ||
}; | ||
var t = _getRequireWildcardCache(r); | ||
if (t && t.has(e)) return t.get(e); | ||
var n = { | ||
__proto__: null | ||
}, | ||
a = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { | ||
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; | ||
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; | ||
} | ||
return n.default = e, t && t.set(e, n), n; | ||
} | ||
var internal = _interopRequireWildcard(require("./internal/commandExecutor.js")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
/** | ||
@@ -35,0 +12,0 @@ * @since 1.0.0 |
@@ -7,28 +7,5 @@ "use strict"; | ||
exports.layer = void 0; | ||
var internal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/fileSystem.js")); | ||
function _getRequireWildcardCache(e) { | ||
if ("function" != typeof WeakMap) return null; | ||
var r = new WeakMap(), | ||
t = new WeakMap(); | ||
return (_getRequireWildcardCache = function (e) { | ||
return e ? t : r; | ||
})(e); | ||
} | ||
function _interopRequireWildcard(e, r) { | ||
if (!r && e && e.__esModule) return e; | ||
if (null === e || "object" != typeof e && "function" != typeof e) return { | ||
default: e | ||
}; | ||
var t = _getRequireWildcardCache(r); | ||
if (t && t.has(e)) return t.get(e); | ||
var n = { | ||
__proto__: null | ||
}, | ||
a = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { | ||
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; | ||
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; | ||
} | ||
return n.default = e, t && t.set(e, n), n; | ||
} | ||
var internal = _interopRequireWildcard(require("./internal/fileSystem.js")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
/** | ||
@@ -35,0 +12,0 @@ * @since 1.0.0 |
@@ -7,28 +7,5 @@ "use strict"; | ||
exports.layer = void 0; | ||
var internal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("../internal/fileSystem/parcelWatcher.js")); | ||
function _getRequireWildcardCache(e) { | ||
if ("function" != typeof WeakMap) return null; | ||
var r = new WeakMap(), | ||
t = new WeakMap(); | ||
return (_getRequireWildcardCache = function (e) { | ||
return e ? t : r; | ||
})(e); | ||
} | ||
function _interopRequireWildcard(e, r) { | ||
if (!r && e && e.__esModule) return e; | ||
if (null === e || "object" != typeof e && "function" != typeof e) return { | ||
default: e | ||
}; | ||
var t = _getRequireWildcardCache(r); | ||
if (t && t.has(e)) return t.get(e); | ||
var n = { | ||
__proto__: null | ||
}, | ||
a = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { | ||
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; | ||
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; | ||
} | ||
return n.default = e, t && t.set(e, n), n; | ||
} | ||
var internal = _interopRequireWildcard(require("../internal/fileSystem/parcelWatcher.js")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
/** | ||
@@ -35,0 +12,0 @@ * @since 1.0.0 |
@@ -7,31 +7,8 @@ "use strict"; | ||
exports.layerFileSystem = void 0; | ||
var KeyValueStore = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/KeyValueStore")); | ||
var Layer = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Layer")); | ||
var FileSystem = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./NodeFileSystem.js")); | ||
var Path = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./NodePath.js")); | ||
function _getRequireWildcardCache(e) { | ||
if ("function" != typeof WeakMap) return null; | ||
var r = new WeakMap(), | ||
t = new WeakMap(); | ||
return (_getRequireWildcardCache = function (e) { | ||
return e ? t : r; | ||
})(e); | ||
} | ||
function _interopRequireWildcard(e, r) { | ||
if (!r && e && e.__esModule) return e; | ||
if (null === e || "object" != typeof e && "function" != typeof e) return { | ||
default: e | ||
}; | ||
var t = _getRequireWildcardCache(r); | ||
if (t && t.has(e)) return t.get(e); | ||
var n = { | ||
__proto__: null | ||
}, | ||
a = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { | ||
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; | ||
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; | ||
} | ||
return n.default = e, t && t.set(e, n), n; | ||
} | ||
var KeyValueStore = _interopRequireWildcard(require("@effect/platform/KeyValueStore")); | ||
var Layer = _interopRequireWildcard(require("effect/Layer")); | ||
var FileSystem = _interopRequireWildcard(require("./NodeFileSystem.js")); | ||
var Path = _interopRequireWildcard(require("./NodePath.js")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
/** | ||
@@ -38,0 +15,0 @@ * @since 1.0.0 |
@@ -7,28 +7,5 @@ "use strict"; | ||
exports.layerWin32 = exports.layerPosix = exports.layer = void 0; | ||
var internal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/path.js")); | ||
function _getRequireWildcardCache(e) { | ||
if ("function" != typeof WeakMap) return null; | ||
var r = new WeakMap(), | ||
t = new WeakMap(); | ||
return (_getRequireWildcardCache = function (e) { | ||
return e ? t : r; | ||
})(e); | ||
} | ||
function _interopRequireWildcard(e, r) { | ||
if (!r && e && e.__esModule) return e; | ||
if (null === e || "object" != typeof e && "function" != typeof e) return { | ||
default: e | ||
}; | ||
var t = _getRequireWildcardCache(r); | ||
if (t && t.has(e)) return t.get(e); | ||
var n = { | ||
__proto__: null | ||
}, | ||
a = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { | ||
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; | ||
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; | ||
} | ||
return n.default = e, t && t.set(e, n), n; | ||
} | ||
var internal = _interopRequireWildcard(require("./internal/path.js")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
/** | ||
@@ -35,0 +12,0 @@ * @since 1.0.0 |
@@ -7,28 +7,5 @@ "use strict"; | ||
exports.runMain = void 0; | ||
var internal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/runtime.js")); | ||
function _getRequireWildcardCache(e) { | ||
if ("function" != typeof WeakMap) return null; | ||
var r = new WeakMap(), | ||
t = new WeakMap(); | ||
return (_getRequireWildcardCache = function (e) { | ||
return e ? t : r; | ||
})(e); | ||
} | ||
function _interopRequireWildcard(e, r) { | ||
if (!r && e && e.__esModule) return e; | ||
if (null === e || "object" != typeof e && "function" != typeof e) return { | ||
default: e | ||
}; | ||
var t = _getRequireWildcardCache(r); | ||
if (t && t.has(e)) return t.get(e); | ||
var n = { | ||
__proto__: null | ||
}, | ||
a = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { | ||
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; | ||
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; | ||
} | ||
return n.default = e, t && t.set(e, n), n; | ||
} | ||
var internal = _interopRequireWildcard(require("./internal/runtime.js")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
/** | ||
@@ -35,0 +12,0 @@ * @since 1.0.0 |
@@ -7,28 +7,5 @@ "use strict"; | ||
exports.fromWritableChannel = exports.fromWritable = void 0; | ||
var internal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/sink.js")); | ||
function _getRequireWildcardCache(e) { | ||
if ("function" != typeof WeakMap) return null; | ||
var r = new WeakMap(), | ||
t = new WeakMap(); | ||
return (_getRequireWildcardCache = function (e) { | ||
return e ? t : r; | ||
})(e); | ||
} | ||
function _interopRequireWildcard(e, r) { | ||
if (!r && e && e.__esModule) return e; | ||
if (null === e || "object" != typeof e && "function" != typeof e) return { | ||
default: e | ||
}; | ||
var t = _getRequireWildcardCache(r); | ||
if (t && t.has(e)) return t.get(e); | ||
var n = { | ||
__proto__: null | ||
}, | ||
a = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { | ||
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; | ||
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; | ||
} | ||
return n.default = e, t && t.set(e, n), n; | ||
} | ||
var internal = _interopRequireWildcard(require("./internal/sink.js")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
/** | ||
@@ -35,0 +12,0 @@ * @category constructor |
@@ -6,39 +6,16 @@ "use strict"; | ||
}); | ||
exports.makeNetChannel = exports.makeNet = exports.layerNet = exports.fromNetSocket = exports.NetSocket = void 0; | ||
var Socket = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/Socket")); | ||
var Channel = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Channel")); | ||
var Context = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Context")); | ||
var Effect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Effect")); | ||
var FiberRef = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/FiberRef")); | ||
var FiberSet = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/FiberSet")); | ||
var Layer = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Layer")); | ||
var Option = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Option")); | ||
var Queue = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Queue")); | ||
var Scope = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Scope")); | ||
var Net = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("node:net")); | ||
function _getRequireWildcardCache(e) { | ||
if ("function" != typeof WeakMap) return null; | ||
var r = new WeakMap(), | ||
t = new WeakMap(); | ||
return (_getRequireWildcardCache = function (e) { | ||
return e ? t : r; | ||
})(e); | ||
} | ||
function _interopRequireWildcard(e, r) { | ||
if (!r && e && e.__esModule) return e; | ||
if (null === e || "object" != typeof e && "function" != typeof e) return { | ||
default: e | ||
}; | ||
var t = _getRequireWildcardCache(r); | ||
if (t && t.has(e)) return t.get(e); | ||
var n = { | ||
__proto__: null | ||
}, | ||
a = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { | ||
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; | ||
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; | ||
} | ||
return n.default = e, t && t.set(e, n), n; | ||
} | ||
exports.makeNetChannel = exports.makeNet = exports.layerNet = exports.fromDuplex = exports.NetSocket = void 0; | ||
var Socket = _interopRequireWildcard(require("@effect/platform/Socket")); | ||
var Channel = _interopRequireWildcard(require("effect/Channel")); | ||
var Context = _interopRequireWildcard(require("effect/Context")); | ||
var Effect = _interopRequireWildcard(require("effect/Effect")); | ||
var FiberRef = _interopRequireWildcard(require("effect/FiberRef")); | ||
var FiberSet = _interopRequireWildcard(require("effect/FiberSet")); | ||
var Layer = _interopRequireWildcard(require("effect/Layer")); | ||
var Option = _interopRequireWildcard(require("effect/Option")); | ||
var Queue = _interopRequireWildcard(require("effect/Queue")); | ||
var Scope = _interopRequireWildcard(require("effect/Scope")); | ||
var Net = _interopRequireWildcard(require("node:net")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
/** | ||
@@ -58,3 +35,3 @@ * @since 1.0.0 | ||
*/ | ||
const makeNet = options => fromNetSocket(Effect.acquireRelease(Effect.async(resume => { | ||
const makeNet = options => fromDuplex(Effect.acquireRelease(Effect.async(resume => { | ||
const conn = Net.createConnection(options); | ||
@@ -90,29 +67,37 @@ conn.on("connect", () => { | ||
exports.makeNet = makeNet; | ||
const fromNetSocket = open => Effect.gen(function* (_) { | ||
const sendQueue = yield* _(Queue.dropping(yield* FiberRef.get(Socket.currentSendQueueCapacity))); | ||
const openContext = yield* Effect.context(); | ||
const run = handler => Effect.gen(function* (_) { | ||
const scope = yield* Effect.scope; | ||
const conn = yield* open.pipe(Effect.provide(Context.add(openContext, Scope.Scope, scope))); | ||
const fiberSet = yield* _(FiberSet.make()); | ||
const run = yield* _(FiberSet.runtime(fiberSet)(), Effect.provideService(NetSocket, conn)); | ||
yield* _(Queue.take(sendQueue), Effect.tap(chunk => Effect.async(resume => { | ||
if (Socket.isCloseEvent(chunk)) { | ||
conn.destroy(chunk.code > 1000 ? new Error(`closed with code ${chunk.code}`) : undefined); | ||
} else if (chunk === EOF) { | ||
conn.end(() => resume(Effect.void)); | ||
} else { | ||
conn.write(chunk, error => { | ||
resume(error ? Effect.fail(new Socket.SocketGenericError({ | ||
reason: "Write", | ||
error | ||
})) : Effect.void); | ||
}); | ||
} | ||
return Effect.void; | ||
})), Effect.forever, Effect.withUnhandledErrorLogLevel(Option.none()), FiberSet.run(fiberSet)); | ||
const fromDuplex = open => FiberRef.get(Socket.currentSendQueueCapacity).pipe(Effect.flatMap(sendQueueCapacity => Queue.dropping(sendQueueCapacity)), Effect.bindTo("sendQueue"), Effect.bind("openContext", () => Effect.context()), Effect.map(({ | ||
openContext, | ||
sendQueue | ||
}) => { | ||
const run = handler => Effect.scope.pipe(Effect.bindTo("scope"), Effect.bind("conn", ({ | ||
scope | ||
}) => open.pipe(Effect.provide(Context.add(openContext, Scope.Scope, scope)))), Effect.bind("fiberSet", _ => FiberSet.make()), Effect.bind("run", ({ | ||
conn, | ||
fiberSet | ||
}) => FiberSet.runtime(fiberSet)().pipe(Effect.provideService(NetSocket, conn))), Effect.tap(({ | ||
conn, | ||
fiberSet | ||
}) => Queue.take(sendQueue).pipe(Effect.tap(chunk => Effect.async(resume => { | ||
if (Socket.isCloseEvent(chunk)) { | ||
conn.destroy(chunk.code > 1000 ? new Error(`closed with code ${chunk.code}`) : undefined); | ||
} else if (chunk === EOF) { | ||
conn.end(() => resume(Effect.void)); | ||
} else { | ||
conn.write(chunk, error => { | ||
resume(error ? Effect.fail(new Socket.SocketGenericError({ | ||
reason: "Write", | ||
error | ||
})) : Effect.void); | ||
}); | ||
} | ||
return Effect.void; | ||
})), Effect.forever, Effect.withUnhandledErrorLogLevel(Option.none()), FiberSet.run(fiberSet))), Effect.tap(({ | ||
conn, | ||
fiberSet, | ||
run | ||
}) => { | ||
conn.on("data", chunk => { | ||
run(handler(chunk)); | ||
}); | ||
yield* _(Effect.async(resume => { | ||
return Effect.async(resume => { | ||
function onEnd() { | ||
@@ -141,4 +126,4 @@ resume(Effect.void); | ||
}); | ||
}), Effect.raceFirst(FiberSet.join(fiberSet))); | ||
}).pipe(Effect.scoped, Effect.interruptible); | ||
}).pipe(Effect.raceFirst(FiberSet.join(fiberSet))); | ||
}), Effect.scoped, Effect.interruptible); | ||
const write = chunk => Queue.offer(sendQueue, chunk); | ||
@@ -152,3 +137,3 @@ const writer = Effect.acquireRelease(Effect.succeed(write), () => Queue.offer(sendQueue, EOF)); | ||
}); | ||
}); | ||
})); | ||
/** | ||
@@ -158,3 +143,3 @@ * @since 1.0.0 | ||
*/ | ||
exports.fromNetSocket = fromNetSocket; | ||
exports.fromDuplex = fromDuplex; | ||
const makeNetChannel = options => Channel.unwrapScoped(Effect.map(makeNet(options), Socket.toChannelWith())); | ||
@@ -161,0 +146,0 @@ /** |
@@ -7,28 +7,5 @@ "use strict"; | ||
exports.toUint8Array = exports.toString = exports.toReadableNever = exports.toReadable = exports.pipeThroughSimple = exports.pipeThroughDuplex = exports.fromReadableChannel = exports.fromReadable = exports.fromDuplex = void 0; | ||
var internal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/stream.js")); | ||
function _getRequireWildcardCache(e) { | ||
if ("function" != typeof WeakMap) return null; | ||
var r = new WeakMap(), | ||
t = new WeakMap(); | ||
return (_getRequireWildcardCache = function (e) { | ||
return e ? t : r; | ||
})(e); | ||
} | ||
function _interopRequireWildcard(e, r) { | ||
if (!r && e && e.__esModule) return e; | ||
if (null === e || "object" != typeof e && "function" != typeof e) return { | ||
default: e | ||
}; | ||
var t = _getRequireWildcardCache(r); | ||
if (t && t.has(e)) return t.get(e); | ||
var n = { | ||
__proto__: null | ||
}, | ||
a = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { | ||
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; | ||
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; | ||
} | ||
return n.default = e, t && t.set(e, n), n; | ||
} | ||
var internal = _interopRequireWildcard(require("./internal/stream.js")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
/** | ||
@@ -35,0 +12,0 @@ * @category constructors |
@@ -7,28 +7,5 @@ "use strict"; | ||
exports.make = exports.layer = void 0; | ||
var InternalTerminal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/terminal.js")); | ||
function _getRequireWildcardCache(e) { | ||
if ("function" != typeof WeakMap) return null; | ||
var r = new WeakMap(), | ||
t = new WeakMap(); | ||
return (_getRequireWildcardCache = function (e) { | ||
return e ? t : r; | ||
})(e); | ||
} | ||
function _interopRequireWildcard(e, r) { | ||
if (!r && e && e.__esModule) return e; | ||
if (null === e || "object" != typeof e && "function" != typeof e) return { | ||
default: e | ||
}; | ||
var t = _getRequireWildcardCache(r); | ||
if (t && t.has(e)) return t.get(e); | ||
var n = { | ||
__proto__: null | ||
}, | ||
a = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { | ||
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; | ||
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; | ||
} | ||
return n.default = e, t && t.set(e, n), n; | ||
} | ||
var InternalTerminal = _interopRequireWildcard(require("./internal/terminal.js")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
/** | ||
@@ -35,0 +12,0 @@ * @since 1.0.0 |
@@ -1,3 +0,1 @@ | ||
/// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
/** | ||
@@ -4,0 +2,0 @@ * @since 1.0.0 |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" resolution-mode="require"/> | ||
/** | ||
@@ -13,2 +12,3 @@ * @since 1.0.0 | ||
import * as Net from "node:net"; | ||
import type { Duplex } from "node:stream"; | ||
/** | ||
@@ -35,3 +35,3 @@ * @since 1.0.0 | ||
*/ | ||
export declare const fromNetSocket: <RO>(open: Effect.Effect<Net.Socket, Socket.SocketError, RO>) => Effect.Effect<Socket.Socket, never, Exclude<RO, Scope.Scope>>; | ||
export declare const fromDuplex: <RO>(open: Effect.Effect<Duplex, Socket.SocketError, RO>) => Effect.Effect<Socket.Socket, never, Exclude<RO, Scope.Scope>>; | ||
/** | ||
@@ -38,0 +38,0 @@ * @since 1.0.0 |
@@ -1,4 +0,1 @@ | ||
/// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
/** | ||
@@ -5,0 +2,0 @@ * @since 1.0.0 |
@@ -25,3 +25,3 @@ /** | ||
*/ | ||
export const makeNet = options => fromNetSocket(Effect.acquireRelease(Effect.async(resume => { | ||
export const makeNet = options => fromDuplex(Effect.acquireRelease(Effect.async(resume => { | ||
const conn = Net.createConnection(options); | ||
@@ -56,29 +56,37 @@ conn.on("connect", () => { | ||
*/ | ||
export const fromNetSocket = open => Effect.gen(function* (_) { | ||
const sendQueue = yield* _(Queue.dropping(yield* FiberRef.get(Socket.currentSendQueueCapacity))); | ||
const openContext = yield* Effect.context(); | ||
const run = handler => Effect.gen(function* (_) { | ||
const scope = yield* Effect.scope; | ||
const conn = yield* open.pipe(Effect.provide(Context.add(openContext, Scope.Scope, scope))); | ||
const fiberSet = yield* _(FiberSet.make()); | ||
const run = yield* _(FiberSet.runtime(fiberSet)(), Effect.provideService(NetSocket, conn)); | ||
yield* _(Queue.take(sendQueue), Effect.tap(chunk => Effect.async(resume => { | ||
if (Socket.isCloseEvent(chunk)) { | ||
conn.destroy(chunk.code > 1000 ? new Error(`closed with code ${chunk.code}`) : undefined); | ||
} else if (chunk === EOF) { | ||
conn.end(() => resume(Effect.void)); | ||
} else { | ||
conn.write(chunk, error => { | ||
resume(error ? Effect.fail(new Socket.SocketGenericError({ | ||
reason: "Write", | ||
error | ||
})) : Effect.void); | ||
}); | ||
} | ||
return Effect.void; | ||
})), Effect.forever, Effect.withUnhandledErrorLogLevel(Option.none()), FiberSet.run(fiberSet)); | ||
export const fromDuplex = open => FiberRef.get(Socket.currentSendQueueCapacity).pipe(Effect.flatMap(sendQueueCapacity => Queue.dropping(sendQueueCapacity)), Effect.bindTo("sendQueue"), Effect.bind("openContext", () => Effect.context()), Effect.map(({ | ||
openContext, | ||
sendQueue | ||
}) => { | ||
const run = handler => Effect.scope.pipe(Effect.bindTo("scope"), Effect.bind("conn", ({ | ||
scope | ||
}) => open.pipe(Effect.provide(Context.add(openContext, Scope.Scope, scope)))), Effect.bind("fiberSet", _ => FiberSet.make()), Effect.bind("run", ({ | ||
conn, | ||
fiberSet | ||
}) => FiberSet.runtime(fiberSet)().pipe(Effect.provideService(NetSocket, conn))), Effect.tap(({ | ||
conn, | ||
fiberSet | ||
}) => Queue.take(sendQueue).pipe(Effect.tap(chunk => Effect.async(resume => { | ||
if (Socket.isCloseEvent(chunk)) { | ||
conn.destroy(chunk.code > 1000 ? new Error(`closed with code ${chunk.code}`) : undefined); | ||
} else if (chunk === EOF) { | ||
conn.end(() => resume(Effect.void)); | ||
} else { | ||
conn.write(chunk, error => { | ||
resume(error ? Effect.fail(new Socket.SocketGenericError({ | ||
reason: "Write", | ||
error | ||
})) : Effect.void); | ||
}); | ||
} | ||
return Effect.void; | ||
})), Effect.forever, Effect.withUnhandledErrorLogLevel(Option.none()), FiberSet.run(fiberSet))), Effect.tap(({ | ||
conn, | ||
fiberSet, | ||
run | ||
}) => { | ||
conn.on("data", chunk => { | ||
run(handler(chunk)); | ||
}); | ||
yield* _(Effect.async(resume => { | ||
return Effect.async(resume => { | ||
function onEnd() { | ||
@@ -107,4 +115,4 @@ resume(Effect.void); | ||
}); | ||
}), Effect.raceFirst(FiberSet.join(fiberSet))); | ||
}).pipe(Effect.scoped, Effect.interruptible); | ||
}).pipe(Effect.raceFirst(FiberSet.join(fiberSet))); | ||
}), Effect.scoped, Effect.interruptible); | ||
const write = chunk => Queue.offer(sendQueue, chunk); | ||
@@ -118,3 +126,3 @@ const writer = Effect.acquireRelease(Effect.succeed(write), () => Queue.offer(sendQueue, EOF)); | ||
}); | ||
}); | ||
})); | ||
/** | ||
@@ -121,0 +129,0 @@ * @since 1.0.0 |
{ | ||
"name": "@effect/platform-node-shared", | ||
"version": "0.0.0-snapshot-28c950c1f2b091132e985b78bbb8d0f72c86ce2f", | ||
"version": "0.0.0-snapshot-3877d62208e83aededdf0b98c4c49b814f4d7da6", | ||
"description": "Unified interfaces for common platform-specific services", | ||
@@ -14,7 +14,7 @@ "license": "MIT", | ||
"@parcel/watcher": "^2.4.1", | ||
"multipasta": "^0.2.1" | ||
"multipasta": "^0.2.2" | ||
}, | ||
"peerDependencies": { | ||
"@effect/platform": "^0.0.0-snapshot-28c950c1f2b091132e985b78bbb8d0f72c86ce2f", | ||
"effect": "^0.0.0-snapshot-28c950c1f2b091132e985b78bbb8d0f72c86ce2f" | ||
"@effect/platform": "^0.0.0-snapshot-3877d62208e83aededdf0b98c4c49b814f4d7da6", | ||
"effect": "^0.0.0-snapshot-3877d62208e83aededdf0b98c4c49b814f4d7da6" | ||
}, | ||
@@ -26,12 +26,2 @@ "publishConfig": { | ||
"./package.json": "./package.json", | ||
"./Http/Etag": { | ||
"types": "./dist/dts/Http/Etag.d.ts", | ||
"import": "./dist/esm/Http/Etag.js", | ||
"default": "./dist/cjs/Http/Etag.js" | ||
}, | ||
"./Http/Multipart": { | ||
"types": "./dist/dts/Http/Multipart.d.ts", | ||
"import": "./dist/esm/Http/Multipart.js", | ||
"default": "./dist/cjs/Http/Multipart.js" | ||
}, | ||
"./NodeCommandExecutor": { | ||
@@ -42,2 +32,7 @@ "types": "./dist/dts/NodeCommandExecutor.d.ts", | ||
}, | ||
"./NodeEtag": { | ||
"types": "./dist/dts/NodeEtag.d.ts", | ||
"import": "./dist/esm/NodeEtag.js", | ||
"default": "./dist/cjs/NodeEtag.js" | ||
}, | ||
"./NodeFileSystem": { | ||
@@ -53,2 +48,7 @@ "types": "./dist/dts/NodeFileSystem.d.ts", | ||
}, | ||
"./NodeMultipart": { | ||
"types": "./dist/dts/NodeMultipart.d.ts", | ||
"import": "./dist/esm/NodeMultipart.js", | ||
"default": "./dist/cjs/NodeMultipart.js" | ||
}, | ||
"./NodePath": { | ||
@@ -87,11 +87,8 @@ "types": "./dist/dts/NodePath.d.ts", | ||
"*": { | ||
"Http/Etag": [ | ||
"./dist/dts/Http/Etag.d.ts" | ||
], | ||
"Http/Multipart": [ | ||
"./dist/dts/Http/Multipart.d.ts" | ||
], | ||
"NodeCommandExecutor": [ | ||
"./dist/dts/NodeCommandExecutor.d.ts" | ||
], | ||
"NodeEtag": [ | ||
"./dist/dts/NodeEtag.d.ts" | ||
], | ||
"NodeFileSystem": [ | ||
@@ -103,2 +100,5 @@ "./dist/dts/NodeFileSystem.d.ts" | ||
], | ||
"NodeMultipart": [ | ||
"./dist/dts/NodeMultipart.d.ts" | ||
], | ||
"NodePath": [ | ||
@@ -105,0 +105,0 @@ "./dist/dts/NodePath.d.ts" |
@@ -16,2 +16,3 @@ /** | ||
import * as Net from "node:net" | ||
import type { Duplex } from "node:stream" | ||
@@ -42,3 +43,3 @@ /** | ||
): Effect.Effect<Socket.Socket, Socket.SocketError> => | ||
fromNetSocket( | ||
fromDuplex( | ||
Effect.acquireRelease( | ||
@@ -76,92 +77,101 @@ Effect.async<Net.Socket, Socket.SocketError, never>((resume) => { | ||
*/ | ||
export const fromNetSocket = <RO>( | ||
open: Effect.Effect<Net.Socket, Socket.SocketError, RO> | ||
export const fromDuplex = <RO>( | ||
open: Effect.Effect<Duplex, Socket.SocketError, RO> | ||
): Effect.Effect<Socket.Socket, never, Exclude<RO, Scope.Scope>> => | ||
Effect.gen(function*(_) { | ||
const sendQueue = yield* _(Queue.dropping<Uint8Array | string | Socket.CloseEvent | typeof EOF>( | ||
yield* FiberRef.get(Socket.currentSendQueueCapacity) | ||
)) | ||
const openContext = yield* Effect.context<Exclude<RO, Scope.Scope>>() | ||
FiberRef.get(Socket.currentSendQueueCapacity).pipe( | ||
Effect.flatMap((sendQueueCapacity) => | ||
Queue.dropping<Uint8Array | string | Socket.CloseEvent | typeof EOF>( | ||
sendQueueCapacity | ||
) | ||
), | ||
Effect.bindTo("sendQueue"), | ||
Effect.bind("openContext", () => Effect.context<Exclude<RO, Scope.Scope>>()), | ||
Effect.map(({ openContext, sendQueue }) => { | ||
const run = <R, E, _>(handler: (_: Uint8Array) => Effect.Effect<_, E, R>) => | ||
Effect.scope.pipe( | ||
Effect.bindTo("scope"), | ||
Effect.bind("conn", ({ scope }) => | ||
open.pipe( | ||
Effect.provide(Context.add(openContext, Scope.Scope, scope)) | ||
) as Effect.Effect<Net.Socket>), | ||
Effect.bind("fiberSet", (_) => FiberSet.make<any, E | Socket.SocketError>()), | ||
Effect.bind("run", ({ conn, fiberSet }) => | ||
FiberSet.runtime(fiberSet)<R>().pipe( | ||
Effect.provideService(NetSocket, conn) | ||
)), | ||
Effect.tap(({ conn, fiberSet }) => | ||
Queue.take(sendQueue).pipe( | ||
Effect.tap((chunk) => | ||
Effect.async<void, Socket.SocketError, never>((resume) => { | ||
if (Socket.isCloseEvent(chunk)) { | ||
conn.destroy(chunk.code > 1000 ? new Error(`closed with code ${chunk.code}`) : undefined) | ||
} else if (chunk === EOF) { | ||
conn.end(() => resume(Effect.void)) | ||
} else { | ||
conn.write(chunk, (error) => { | ||
resume( | ||
error ? Effect.fail(new Socket.SocketGenericError({ reason: "Write", error })) : Effect.void | ||
) | ||
}) | ||
} | ||
return Effect.void | ||
}) | ||
), | ||
Effect.forever, | ||
Effect.withUnhandledErrorLogLevel(Option.none()), | ||
FiberSet.run(fiberSet) | ||
) | ||
), | ||
Effect.tap(({ conn, fiberSet, run }) => { | ||
conn.on("data", (chunk) => { | ||
run(handler(chunk)) | ||
}) | ||
const run = <R, E, _>(handler: (_: Uint8Array) => Effect.Effect<_, E, R>) => | ||
Effect.gen(function*(_) { | ||
const scope = yield* Effect.scope | ||
const conn = yield* open.pipe( | ||
Effect.provide(Context.add(openContext, Scope.Scope, scope)) | ||
) as Effect.Effect<Net.Socket> | ||
const fiberSet = yield* _(FiberSet.make<any, E | Socket.SocketError>()) | ||
const run = yield* _( | ||
FiberSet.runtime(fiberSet)<R>(), | ||
Effect.provideService(NetSocket, conn) | ||
) | ||
yield* _( | ||
Queue.take(sendQueue), | ||
Effect.tap((chunk) => | ||
Effect.async<void, Socket.SocketError, never>((resume) => { | ||
if (Socket.isCloseEvent(chunk)) { | ||
conn.destroy(chunk.code > 1000 ? new Error(`closed with code ${chunk.code}`) : undefined) | ||
} else if (chunk === EOF) { | ||
conn.end(() => resume(Effect.void)) | ||
} else { | ||
conn.write(chunk, (error) => { | ||
resume(error ? Effect.fail(new Socket.SocketGenericError({ reason: "Write", error })) : Effect.void) | ||
}) | ||
return Effect.async<void, Socket.SocketError, never>((resume) => { | ||
function onEnd() { | ||
resume(Effect.void) | ||
} | ||
return Effect.void | ||
}) | ||
), | ||
Effect.forever, | ||
Effect.withUnhandledErrorLogLevel(Option.none()), | ||
FiberSet.run(fiberSet) | ||
) | ||
conn.on("data", (chunk) => { | ||
run(handler(chunk)) | ||
}) | ||
yield* _( | ||
Effect.async<void, Socket.SocketError, never>((resume) => { | ||
function onEnd() { | ||
resume(Effect.void) | ||
} | ||
function onError(error: Error) { | ||
resume(Effect.fail(new Socket.SocketGenericError({ reason: "Read", error }))) | ||
} | ||
function onClose(hadError: boolean) { | ||
resume( | ||
Effect.fail( | ||
new Socket.SocketCloseError({ | ||
reason: "Close", | ||
code: hadError ? 1006 : 1000 | ||
}) | ||
function onError(error: Error) { | ||
resume(Effect.fail(new Socket.SocketGenericError({ reason: "Read", error }))) | ||
} | ||
function onClose(hadError: boolean) { | ||
resume( | ||
Effect.fail( | ||
new Socket.SocketCloseError({ | ||
reason: "Close", | ||
code: hadError ? 1006 : 1000 | ||
}) | ||
) | ||
) | ||
) | ||
} | ||
conn.on("end", onEnd) | ||
conn.on("error", onError) | ||
conn.on("close", onClose) | ||
return Effect.sync(() => { | ||
conn.off("end", onEnd) | ||
conn.off("error", onError) | ||
conn.off("close", onClose) | ||
}) | ||
} | ||
conn.on("end", onEnd) | ||
conn.on("error", onError) | ||
conn.on("close", onClose) | ||
return Effect.sync(() => { | ||
conn.off("end", onEnd) | ||
conn.off("error", onError) | ||
conn.off("close", onClose) | ||
}) | ||
}).pipe( | ||
Effect.raceFirst(FiberSet.join(fiberSet)) | ||
) | ||
}), | ||
Effect.raceFirst(FiberSet.join(fiberSet)) | ||
Effect.scoped, | ||
Effect.interruptible | ||
) | ||
}).pipe( | ||
Effect.scoped, | ||
Effect.interruptible | ||
const write = (chunk: Uint8Array | string | Socket.CloseEvent) => Queue.offer(sendQueue, chunk) | ||
const writer = Effect.acquireRelease( | ||
Effect.succeed(write), | ||
() => Queue.offer(sendQueue, EOF) | ||
) | ||
const write = (chunk: Uint8Array | string | Socket.CloseEvent) => Queue.offer(sendQueue, chunk) | ||
const writer = Effect.acquireRelease( | ||
Effect.succeed(write), | ||
() => Queue.offer(sendQueue, EOF) | ||
) | ||
return Socket.Socket.of({ | ||
[Socket.TypeId]: Socket.TypeId, | ||
run, | ||
runRaw: run, | ||
writer | ||
return Socket.Socket.of({ | ||
[Socket.TypeId]: Socket.TypeId, | ||
run, | ||
runRaw: run, | ||
writer | ||
}) | ||
}) | ||
}) | ||
) | ||
@@ -191,5 +201,2 @@ /** | ||
export const layerNet = (options: Net.NetConnectOpts): Layer.Layer<Socket.Socket, Socket.SocketError> => | ||
Layer.effect( | ||
Socket.Socket, | ||
makeNet(options) | ||
) | ||
Layer.effect(Socket.Socket, makeNet(options)) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
394147
5563
Updatedmultipasta@^0.2.2