Skip to content

Commit

Permalink
fix: 禁止设置已用ID
Browse files Browse the repository at this point in the history
  • Loading branch information
MarleneJiang committed Sep 20, 2023
1 parent c8a6447 commit 6dd96e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions package/pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ export class Pipe<T, R> {
}

async execute(input: T | T[], context: PipelineContext): Promise<R | R[]> {
if(this.options.id === "self_params" || this.options.id === "index_input"){
throw new Error("禁止设置id为self_params或index_input");
}
!!this.options.params &&
context.stepParams?.set(this.options.id, this.options.params);
context.stepParams?.set("self_params",this.options.params || "")
Expand Down

0 comments on commit 6dd96e8

Please sign in to comment.