mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-17 23:14:03 +01:00
NodeJS Plugin Runtime (#53)
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
import jp from 'jsonpath';
|
||||
|
||||
export function pluginHookResponseFilter(ctx, filter, text) {
|
||||
let parsed;
|
||||
try {
|
||||
parsed = JSON.parse(text);
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
const filtered = jp.query(parsed, filter);
|
||||
return { filtered: JSON.stringify(filtered, null, 2) };
|
||||
}
|
||||
Reference in New Issue
Block a user