Skip to content

Commit

Permalink
moved regex
Browse files Browse the repository at this point in the history
  • Loading branch information
snakajima committed May 9, 2024
1 parent 1d1a79d commit da63a07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export class ComputedNode extends Node {
constructor(graphId: string, nodeId: string, data: ComputedNodeData, graph: GraphAI) {
super(nodeId, graph);
this.graphId = graphId;
const regex = /^\$\{(.+)\}$/;
this.params = data.params ?? {};
this.nestedGraph = data.graph;
if (typeof data.agent === "string") {
Expand All @@ -99,6 +98,7 @@ export class ComputedNode extends Node {
assert(!!this.ifSource.nodeId, `Invalid data source ${data.if}`);
this.pendings.add(this.ifSource.nodeId);
}
const regex = /^\$\{(.+)\}$/;
this.dynamicParams = Object.keys(this.params).reduce((tmp: Record<string, DataSource>, key) => {
const value = this.params[key];
const match = typeof value === "string" ? value.match(regex) : null;
Expand Down

0 comments on commit da63a07

Please sign in to comment.