Move everything into subdir for repo merge

This commit is contained in:
Gregory Schier
2025-05-29 07:16:39 -07:00
parent 385a369699
commit 723e8d2874
90 changed files with 919 additions and 0 deletions

View File

@@ -1,21 +0,0 @@
import { DOMParser } from '@xmldom/xmldom';
import { PluginDefinition } from '@yaakapp/api';
import xpath from 'xpath';
export const plugin: PluginDefinition = {
filter: {
name: 'XPath',
description: 'Filter XPath',
onFilter(_ctx, args) {
const doc = new DOMParser().parseFromString(args.payload, 'text/xml');
const result = xpath.select(args.filter, doc, false);
if (Array.isArray(result)) {
return { filtered: result.map(r => String(r)).join('\n') };
} else {
// Not sure what cases this happens in (?)
return { filtered: String(result) };
}
},
},
};