Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions canisters/src/data/data.filter.mo
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ module {
};
};

public func contains(key: Text, contains: ?Text): Bool {
switch (contains) {
public func notContains(key: Text, notContains: ?Text): Bool {
switch (notContains) {
case null {
return true;
};
case (?contains) {
return Text.contains(key, #text contains);
case (?notContains) {
return not Text.contains(key, #text notContains);
};
};
};
Expand Down
2 changes: 1 addition & 1 deletion canisters/src/data/data.store.mo
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module {
let {startsWith; notContains} = filter;

let values: [(Text, T)] = Array.mapFilter<(Text, T), (Text, T)>(keyValues, func ((key: Text, value: T)) : ?(Text, T) {
if (Filter.startsWith(key, startsWith) and not Filter.contains(key, notContains)) {
if (Filter.startsWith(key, startsWith) and Filter.notContains(key, notContains)) {
return ?(key, value);
};

Expand Down