Skip to content

Commit

Permalink
fix: type error
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangfisher committed Dec 25, 2024
1 parent 504e2a4 commit ff93502
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ function wrapperFilter(this:FlexVars, filter:FlexFilter, args:any[], context:Fle
filter.args.forEach((argName:string,index:number)=>{
if(args[index]!==undefined) finalArgs[argName] = args[index]
})
}
}
}
//
return (value:any)=>{
Expand Down
3 changes: 2 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export type FilterEmptyHandler = (this:FlexVars,value:any,args:Record<string,any
export type FilexFilterErrorBehavior = 'throw' | 'ignore' | 'break'

export interface FlexFilter<Args extends Record<string,any> = Record<string,any>>{
name? : string
name : string
// 过滤器执行优先级
// normal:普通过滤器,按照声明顺序执行
// before: 无论该过滤器放在哪里,都会在普通过滤器之前执行
Expand All @@ -47,3 +47,4 @@ export interface FlexFilter<Args extends Record<string,any> = Record<string,any>
// 当过滤器执行返回空值时的处理函数,空值是指null,undefined
onEmpty? : FilterEmptyHandler
}

0 comments on commit ff93502

Please sign in to comment.