Skip to content

Commit 8bd0615

Browse files
authored
feat: add filter field in read all options. (#1)
1 parent 7739253 commit 8bd0615

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

crates/bridge/src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ pub fn read_all(client: Client, mut cx: FunctionContext) -> JsResult<JsPromise>
259259
}
260260

261261
if let Some(regex) = filter_obj.get_opt::<JsString, _, _>(&mut cx, "regex")? {
262-
subscription_filter = subscription_filter.regex(&regex.value(&mut cx));
262+
subscription_filter = subscription_filter.regex(regex.value(&mut cx));
263263
}
264264

265265
options = options.filter(subscription_filter);

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export type RustReadAllOptions = {
5151
requiresLeader: boolean;
5252
resolvesLink: boolean;
5353
credentials?: { username: string; password: string };
54+
filter?: Filter;
5455
};
5556

5657
export const STREAM_NAME = "streamName";
@@ -64,6 +65,8 @@ export type RustReadAllFilterBase = {
6465
filterOn: FilterOn;
6566
};
6667

68+
export type Filter = RegexFilter | PrefixesFilter;
69+
6770
export interface RegexFilter extends RustReadAllFilterBase {
6871
regex: string;
6972
}

0 commit comments

Comments
 (0)