ravendb
Version:
RavenDB client for Node.js
25 lines • 872 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.JsonlStringer = void 0;
const node_stream_1 = require("node:stream");
class JsonlStringer extends node_stream_1.Transform {
_replacer;
static make(options) {
return new JsonlStringer(options);
}
constructor(options) {
super(Object.assign({}, options, { writableObjectMode: true, readableObjectMode: false }));
this._replacer = options && options.replacer;
}
_transform(chunk, _, callback) {
this.push(JSON.stringify(chunk, this._replacer));
this._transform = this._nextTransform;
callback(null);
}
_nextTransform(chunk, _, callback) {
this.push('\n' + JSON.stringify(chunk, this._replacer));
callback(null);
}
}
exports.JsonlStringer = JsonlStringer;
//# sourceMappingURL=Stringer.js.map