@farar/nodes
Advanced tools
Comparing version 0.4.1 to 0.5.0
@@ -9,2 +9,3 @@ import * as stream from 'node:stream'; | ||
constructor({ time }: AnyTemporalToAnyOptions, streamOptions?: stream.TransformOptions); | ||
write(data: InT, encoding?: BufferEncoding): void; | ||
} |
@@ -25,5 +25,9 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.AnyTemporalToAny = void 0; | ||
const stream = __importStar(require("node:stream")); | ||
const config_js_1 = __importDefault(require("../../config.js")); | ||
const node_js_1 = require("../../node.js"); | ||
@@ -58,3 +62,6 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
} | ||
write(data, encoding) { | ||
super._write(data, encoding).catch((err) => config_js_1.default.errorHandler(err)); | ||
} | ||
} | ||
exports.AnyTemporalToAny = AnyTemporalToAny; |
@@ -8,2 +8,3 @@ import * as stream from 'node:stream'; | ||
constructor(streamOptions?: stream.TransformOptions); | ||
write(data: InT, encoding?: BufferEncoding): void; | ||
} |
@@ -25,2 +25,5 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -30,2 +33,3 @@ exports.AnyToAnyEmitter = void 0; | ||
const events = __importStar(require("node:events")); | ||
const config_js_1 = __importDefault(require("../../config.js")); | ||
const node_js_1 = require("../../node.js"); | ||
@@ -63,3 +67,6 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
} | ||
write(data, encoding) { | ||
super._write(data, encoding).catch((err) => config_js_1.default.errorHandler(err)); | ||
} | ||
} | ||
exports.AnyToAnyEmitter = AnyToAnyEmitter; |
@@ -8,2 +8,3 @@ import * as stream from 'node:stream'; | ||
constructor(streamOptions?: stream.WritableOptions); | ||
write(data: InT, encoding?: BufferEncoding): void; | ||
} |
@@ -25,2 +25,5 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -30,2 +33,3 @@ exports.AnyToEmitter = void 0; | ||
const events = __importStar(require("node:events")); | ||
const config_js_1 = __importDefault(require("../../config.js")); | ||
const node_js_1 = require("../../node.js"); | ||
@@ -63,3 +67,6 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
} | ||
write(data, encoding) { | ||
super._write(data, encoding).catch((err) => config_js_1.default.errorHandler(err)); | ||
} | ||
} | ||
exports.AnyToEmitter = AnyToEmitter; |
@@ -6,2 +6,3 @@ import * as stream from 'node:stream'; | ||
constructor(streamOptions?: stream.WritableOptions); | ||
write(data: InT, encoding?: BufferEncoding): void; | ||
} |
@@ -25,5 +25,9 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.AnyToVoid = void 0; | ||
const stream = __importStar(require("node:stream")); | ||
const config_js_1 = __importDefault(require("../../config.js")); | ||
const node_js_1 = require("../../node.js"); | ||
@@ -56,3 +60,6 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
} | ||
write(data, encoding) { | ||
super._write(data, encoding).catch((err) => config_js_1.default.errorHandler(err)); | ||
} | ||
} | ||
exports.AnyToVoid = AnyToVoid; |
@@ -13,3 +13,3 @@ import { Readable, Writable } from 'node:stream'; | ||
disconnect(...nodes: Array<Node<OutT, unknown>>): typeof this; | ||
write(data: InT, encoding?: BufferEncoding): Promise<void>; | ||
protected _write(data: InT, encoding?: NodeJS.BufferEncoding): Promise<void>; | ||
} |
@@ -89,3 +89,3 @@ "use strict"; | ||
} | ||
async write(data, encoding) { | ||
async _write(data, encoding) { | ||
if (!this._stream.closed && this._stream instanceof node_stream_1.Writable) { | ||
@@ -92,0 +92,0 @@ if (!this._stream.writableNeedDrain) { |
{ | ||
"name": "@farar/nodes", | ||
"version": "0.4.1", | ||
"version": "0.5.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -71,6 +71,6 @@ # Nodes | ||
_protected_ **node\[$write\](data)** | ||
_protected_ **node._write(data, encoding)** | ||
- data `<InT>` Data to write to the writable side of the stream. | ||
- encoding `<NodeJS.BufferEncoding>` An optional Node.js [encoding](https://nodejs.org/api/buffer.html#buffers-and-character-encodings) **Default: `utf-8`**. | ||
Returns: `<Promise<void>>` | ||
@@ -77,0 +77,0 @@ |
53586
1055