import { primordials } from "ext:core/mod.js";
import stream from "node:stream";
"use strict";
const {
ObjectDefineProperties,
ObjectDefineProperty,
ObjectSetPrototypeOf,
} = primordials;
function LazyTransform(options) {
this._options = options;
}
ObjectSetPrototypeOf(LazyTransform.prototype, stream.Transform.prototype);
ObjectSetPrototypeOf(LazyTransform, stream.Transform);
function makeGetter(name) {
return function () {
stream.Transform.call(this, this._options);
this._writableState.decodeStrings = false;
return this[name];
};
}
function makeSetter(name) {
return function (val) {
ObjectDefineProperty(this, name, {
__proto__: null,
value: val,
enumerable: true,
configurable: true,
writable: true,
});
};
}
ObjectDefineProperties(LazyTransform.prototype, {
_readableState: {
__proto__: null,
get: makeGetter("_readableState"),
set: makeSetter("_readableState"),
configurable: true,
enumerable: true,
},
_writableState: {
__proto__: null,
get: makeGetter("_writableState"),
set: makeSetter("_writableState"),
configurable: true,
enumerable: true,
},
});
export default LazyTransform;
export { LazyTransform };