Add an option to allow jsonpath/xpath to return as array (#297)

Co-authored-by: Gregory Schier <gschier1990@gmail.com>
This commit is contained in:
Gregor Majcen
2025-11-13 14:57:11 +01:00
committed by GitHub
parent a4c4663011
commit 593a7ab7e5
34 changed files with 800 additions and 338 deletions

View File

@@ -1,9 +1,10 @@
import type { CallTemplateFunctionArgs, Context, PluginDefinition } from '@yaakapp/api';
import fs from 'node:fs';
const UTF8 = 'utf8';
const options = [
{ label: 'ASCII', value: 'ascii' },
{ label: 'UTF-8', value: 'utf8' },
{ label: 'UTF-8', value: UTF8 },
{ label: 'UTF-16 LE', value: 'utf16le' },
{ label: 'Base64', value: 'base64' },
{ label: 'Base64 URL-safe', value: 'base64url' },
@@ -18,12 +19,11 @@ export const plugin: PluginDefinition = {
args: [
{ title: 'Select File', type: 'file', name: 'path', label: 'File' },
{
title: 'Select encoding',
type: 'select',
name: 'encoding',
label: 'Encoding',
defaultValue: 'utf8',
description: 'Specifies how the files bytes are decoded into text when read',
defaultValue: UTF8,
description: "Specifies how the file's bytes are decoded into text when read",
options,
},
],