diff --git a/packages/core/src/parser/conditions.ts b/packages/core/src/parser/conditions.ts index 85d7be51..c9258d36 100644 --- a/packages/core/src/parser/conditions.ts +++ b/packages/core/src/parser/conditions.ts @@ -367,6 +367,19 @@ export abstract class BaseConditionParser { } return streams.length; }; + + this.parser.functions.not = function ( + streams: ParsedStream[], + originalStreams: ParsedStream[] + ) { + if (!Array.isArray(originalStreams)) { + throw new Error( + "Please use one of 'totalStreams' or 'previousStreams' as the second argument" + ); + } + const streamIds = new Set(streams.map((stream) => stream.id)); + return originalStreams.filter((stream) => !streamIds.has(stream.id)); + }; } protected async evaluateCondition(condition: string): Promise {