applesauce-core 0.0.0-next-20250610175335 → 0.0.0-next-20250615164746
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,4 +6,4 @@ export declare function getArticleImage(article: NostrEvent): string | undefined
|
|
|
6
6
|
/** Returns an articles summary, if it exists */
|
|
7
7
|
export declare function getArticleSummary(article: NostrEvent): string | undefined;
|
|
8
8
|
/** Returns an articles published date, if it exists */
|
|
9
|
-
export declare function
|
|
9
|
+
export declare function getArticlePublished(article: NostrEvent): number;
|
package/dist/helpers/article.js
CHANGED
|
@@ -12,7 +12,7 @@ export function getArticleSummary(article) {
|
|
|
12
12
|
return getTagValue(article, "summary");
|
|
13
13
|
}
|
|
14
14
|
/** Returns an articles published date, if it exists */
|
|
15
|
-
export function
|
|
15
|
+
export function getArticlePublished(article) {
|
|
16
16
|
const ts = getTagValue(article, "published_at");
|
|
17
17
|
if (ts && !Number.isNaN(parseInt(ts)))
|
|
18
18
|
return parseInt(ts);
|
|
@@ -61,7 +61,7 @@ export declare function addRelayHintsToPointer<T extends {
|
|
|
61
61
|
/** Gets the hex pubkey from any nip-19 encoded string */
|
|
62
62
|
export declare function normalizeToPubkey(str: string): string;
|
|
63
63
|
/** Converts hex to nsec strings into Uint8 secret keys */
|
|
64
|
-
export declare function normalizeToSecretKey(str: string): Uint8Array;
|
|
64
|
+
export declare function normalizeToSecretKey(str: string | Uint8Array): Uint8Array;
|
|
65
65
|
/**
|
|
66
66
|
* Merges two event points and keeps all relays
|
|
67
67
|
* @throws if the ids are different
|
package/dist/helpers/pointers.js
CHANGED
|
@@ -198,7 +198,9 @@ export function normalizeToPubkey(str) {
|
|
|
198
198
|
}
|
|
199
199
|
/** Converts hex to nsec strings into Uint8 secret keys */
|
|
200
200
|
export function normalizeToSecretKey(str) {
|
|
201
|
-
if (
|
|
201
|
+
if (str instanceof Uint8Array)
|
|
202
|
+
return str;
|
|
203
|
+
else if (isHexKey(str))
|
|
202
204
|
return hexToBytes(str);
|
|
203
205
|
else {
|
|
204
206
|
const decode = nip19.decode(str);
|
package/dist/models/common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defer, distinctUntilChanged, EMPTY, endWith, filter, finalize, from, map, merge, mergeWith, of, repeat, scan, takeUntil, tap, } from "rxjs";
|
|
2
|
-
import { createReplaceableAddress, getEventUID, getReplaceableIdentifier, isReplaceable, matchFilters } from "../helpers/index.js";
|
|
2
|
+
import { createReplaceableAddress, getEventUID, getReplaceableIdentifier, isReplaceable, matchFilters, } from "../helpers/index.js";
|
|
3
3
|
import { claimEvents } from "../observable/claim-events.js";
|
|
4
4
|
import { claimLatest } from "../observable/claim-latest.js";
|
|
5
5
|
import { insertEventIntoDescendingList } from "nostr-tools/utils";
|