applesauce-core
Advanced tools
Comparing version 0.6.0 to 0.7.0
/// <reference types="debug" /> | ||
/// <reference types="zen-observable" /> | ||
import { Filter, NostrEvent } from "nostr-tools"; | ||
import { LRU } from "../utils/lru.js"; | ||
import { LRU } from "../helpers/lru.js"; | ||
/** | ||
@@ -9,3 +9,3 @@ * An in-memory database for nostr events | ||
export declare class Database { | ||
log: import("debug").Debugger; | ||
protected log: import("debug").Debugger; | ||
/** Indexes */ | ||
@@ -60,2 +60,3 @@ protected kinds: Map<number, Set<import("nostr-tools").Event>>; | ||
}; | ||
get size(): number; | ||
protected claims: WeakMap<import("nostr-tools").Event, any>; | ||
@@ -62,0 +63,0 @@ /** Index helper methods */ |
@@ -6,3 +6,3 @@ import { binarySearch, insertEventIntoDescendingList } from "nostr-tools/utils"; | ||
import { logger } from "../logger.js"; | ||
import { LRU } from "../utils/lru.js"; | ||
import { LRU } from "../helpers/lru.js"; | ||
/** | ||
@@ -29,2 +29,5 @@ * An in-memory database for nostr events | ||
deleted = this.deletedSignal.observable; | ||
get size() { | ||
return this.events.size; | ||
} | ||
claims = new WeakMap(); | ||
@@ -31,0 +34,0 @@ /** Index helper methods */ |
@@ -11,1 +11,5 @@ export * from "./profile.js"; | ||
export * from "./tags.js"; | ||
export * from "./emoji.js"; | ||
export * from "./lru.js"; | ||
export * from "./hashtag.js"; | ||
export * from "./url.js"; |
@@ -11,1 +11,5 @@ export * from "./profile.js"; | ||
export * from "./tags.js"; | ||
export * from "./emoji.js"; | ||
export * from "./lru.js"; | ||
export * from "./hashtag.js"; | ||
export * from "./url.js"; |
export declare function isHex(str?: string): boolean; | ||
export declare function isHexKey(key?: string): boolean; | ||
export declare function stripInvisibleChar(str: string): string; | ||
export declare function stripInvisibleChar(str?: string | undefined): string | undefined; |
@@ -11,1 +11,4 @@ export function isHex(str) { | ||
} | ||
export function stripInvisibleChar(str) { | ||
return str && str.replaceAll(/[\p{Cf}\p{Zs}]/gu, ""); | ||
} |
export * from "./stateful.js"; | ||
export * from "./throttle.js"; | ||
export * from "./getValue.js"; |
export * from "./stateful.js"; | ||
export * from "./throttle.js"; | ||
export * from "./getValue.js"; |
import Observable from "zen-observable"; | ||
import { Filter, NostrEvent } from "nostr-tools"; | ||
import { EventStore } from "../event-store/event-store.js"; | ||
import { LRU } from "../utils/lru.js"; | ||
import { StatefulObservable } from "../observable/stateful.js"; | ||
import { LRU } from "../helpers/lru.js"; | ||
import * as Queries from "../queries/index.js"; | ||
@@ -16,3 +17,3 @@ import { AddressPointer, EventPointer } from "nostr-tools/nip19"; | ||
constructor(store: EventStore); | ||
queries: LRU<Observable<any>>; | ||
queries: LRU<StatefulObservable<any>>; | ||
/** Creates a cached query */ | ||
@@ -19,0 +20,0 @@ runQuery<T extends unknown, Args extends Array<any>>(queryConstructor: (...args: Args) => { |
import { stateful } from "../observable/stateful.js"; | ||
import { LRU } from "../utils/lru.js"; | ||
import { LRU } from "../helpers/lru.js"; | ||
import * as Queries from "../queries/index.js"; | ||
@@ -4,0 +4,0 @@ export class QueryStore { |
{ | ||
"name": "applesauce-core", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "type": "module", |
86507
77
2092