Skip to content

Commit

Permalink
fixing getFunctions
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed Mar 10, 2022
1 parent 3b22d31 commit a35b17c
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/plugins/expressions/common/executor/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,11 @@ export class Executor<Context extends Record<string, unknown> = Record<string, u
}

public getFunctions(namespace?: string): Record<string, ExpressionFunction> {
if (namespace) {
const fns = Object.entries(this.container.get().functions);
const filtered = fns.filter(
([key, value]) => !value.namespace || value.namespace === namespace
);
return Object.fromEntries(filtered);
} else {
return { ...this.container.get().functions };
}
const fns = Object.entries(this.container.get().functions);
const filtered = fns.filter(
([key, value]) => !value.namespace || value.namespace === namespace
);
return Object.fromEntries(filtered);
}

public registerType(
Expand Down

0 comments on commit a35b17c

Please sign in to comment.