mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-23 18:01:21 +01:00
Move plugins to this repo
This commit is contained in:
10
plugins/filter-xpath/src/index.ts
Normal file
10
plugins/filter-xpath/src/index.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { DOMParser } from '@xmldom/xmldom';
|
||||
import xpath from 'xpath';
|
||||
|
||||
export function pluginHookResponseFilter(
|
||||
_ctx: any,
|
||||
{ filter, body }: { filter: string; body: string },
|
||||
) {
|
||||
const doc = new DOMParser().parseFromString(body, 'text/xml');
|
||||
return `${xpath.select(filter, doc)}`;
|
||||
}
|
||||
Reference in New Issue
Block a user