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
+1
View File
@@ -0,0 +1 @@
export const fromUtf8 = (input) => new TextEncoder().encode(input);
+5
View File
@@ -0,0 +1,5 @@
import { fromString } from "@smithy/util-buffer-from";
export const fromUtf8 = (input) => {
const buf = fromString(input, "utf8");
return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);
};
+3
View File
@@ -0,0 +1,3 @@
export * from "./fromUtf8";
export * from "./toUint8Array";
export * from "./toUtf8";
+10
View File
@@ -0,0 +1,10 @@
import { fromUtf8 } from "./fromUtf8";
export const toUint8Array = (data) => {
if (typeof data === "string") {
return fromUtf8(data);
}
if (ArrayBuffer.isView(data)) {
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
}
return new Uint8Array(data);
};
+1
View File
@@ -0,0 +1 @@
export const toUtf8 = (input) => new TextDecoder("utf-8").decode(input);
+2
View File
@@ -0,0 +1,2 @@
import { fromArrayBuffer } from "@smithy/util-buffer-from";
export const toUtf8 = (input) => fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("utf8");