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
+53
View File
@@ -0,0 +1,53 @@
export const _toStr = (val) => {
if (val == null) {
return val;
}
if (typeof val === "number" || typeof val === "bigint") {
const warning = new Error(`Received number ${val} where a string was expected.`);
warning.name = "Warning";
console.warn(warning);
return String(val);
}
if (typeof val === "boolean") {
const warning = new Error(`Received boolean ${val} where a string was expected.`);
warning.name = "Warning";
console.warn(warning);
return String(val);
}
return val;
};
export const _toBool = (val) => {
if (val == null) {
return val;
}
if (typeof val === "number") {
}
if (typeof val === "string") {
const lowercase = val.toLowerCase();
if (val !== "" && lowercase !== "false" && lowercase !== "true") {
const warning = new Error(`Received string "${val}" where a boolean was expected.`);
warning.name = "Warning";
console.warn(warning);
}
return val !== "" && lowercase !== "false";
}
return val;
};
export const _toNum = (val) => {
if (val == null) {
return val;
}
if (typeof val === "boolean") {
}
if (typeof val === "string") {
const num = Number(val);
if (num.toString() !== val) {
const warning = new Error(`Received string "${val}" where a number was expected.`);
warning.name = "Warning";
console.warn(warning);
return val;
}
return num;
}
return val;
};
+2
View File
@@ -0,0 +1,2 @@
export * from "./coercing-serializers";
export * from "./json/awsExpectUnion";
+10
View File
@@ -0,0 +1,10 @@
import { expectUnion } from "@smithy/smithy-client";
export const awsExpectUnion = (value) => {
if (value == null) {
return undefined;
}
if (typeof value === "object" && "__type" in value) {
delete value.__type;
}
return expectUnion(value);
};