working rss feed to nostr publish

This commit is contained in:
2023-11-24 00:43:28 -05:00
parent 06edcb57ae
commit 88d2f9cfec
8396 changed files with 783105 additions and 0 deletions
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventStreamMarshaller = void 0;
const eventstream_serde_universal_1 = require("@smithy/eventstream-serde-universal");
const utils_1 = require("./utils");
class EventStreamMarshaller {
constructor({ utf8Encoder, utf8Decoder }) {
this.universalMarshaller = new eventstream_serde_universal_1.EventStreamMarshaller({
utf8Decoder,
utf8Encoder,
});
}
deserialize(body, deserializer) {
const bodyIterable = isReadableStream(body) ? (0, utils_1.readableStreamtoIterable)(body) : body;
return this.universalMarshaller.deserialize(bodyIterable, deserializer);
}
serialize(input, serializer) {
const serialziedIterable = this.universalMarshaller.serialize(input, serializer);
return typeof ReadableStream === "function" ? (0, utils_1.iterableToReadableStream)(serialziedIterable) : serialziedIterable;
}
}
exports.EventStreamMarshaller = EventStreamMarshaller;
const isReadableStream = (body) => typeof ReadableStream === "function" && body instanceof ReadableStream;
+6
View File
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./EventStreamMarshaller"), exports);
tslib_1.__exportStar(require("./provider"), exports);
tslib_1.__exportStar(require("./utils"), exports);
+6
View File
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.eventStreamSerdeProvider = void 0;
const EventStreamMarshaller_1 = require("./EventStreamMarshaller");
const eventStreamSerdeProvider = (options) => new EventStreamMarshaller_1.EventStreamMarshaller(options);
exports.eventStreamSerdeProvider = eventStreamSerdeProvider;
+33
View File
@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.iterableToReadableStream = exports.readableStreamtoIterable = void 0;
const readableStreamtoIterable = (readableStream) => ({
[Symbol.asyncIterator]: async function* () {
const reader = readableStream.getReader();
try {
while (true) {
const { done, value } = await reader.read();
if (done)
return;
yield value;
}
}
finally {
reader.releaseLock();
}
},
});
exports.readableStreamtoIterable = readableStreamtoIterable;
const iterableToReadableStream = (asyncIterable) => {
const iterator = asyncIterable[Symbol.asyncIterator]();
return new ReadableStream({
async pull(controller) {
const { done, value } = await iterator.next();
if (done) {
return controller.close();
}
controller.enqueue(value);
},
});
};
exports.iterableToReadableStream = iterableToReadableStream;