mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-24 10:21:15 +01:00
Move plugins to this repo
This commit is contained in:
7
plugins/filter-jsonpath/src/index.ts
Normal file
7
plugins/filter-jsonpath/src/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import jp from 'jsonpath';
|
||||
|
||||
export function pluginHookResponseFilter(_ctx: any, args: { filter: string; body: string }) {
|
||||
const parsed = JSON.parse(args.body);
|
||||
const filtered = jp.query(parsed, args.filter);
|
||||
return JSON.stringify(filtered, null, 2);
|
||||
}
|
||||
Reference in New Issue
Block a user