URL path placeholders

This commit is contained in:
Gregory Schier
2024-08-30 05:24:07 -07:00
parent b3865d383b
commit afa64acf83
20 changed files with 267 additions and 73 deletions

View File

@@ -42,12 +42,13 @@ export function BulkPairEditor({
);
}
function lineToPair(l: string): PairEditorProps['pairs'][0] {
const [name, ...values] = l.split(':');
function lineToPair(line: string): PairEditorProps['pairs'][0] {
const [, name, value] = line.match(/^(:?[^:]+):\s+([^$]*)/) ?? [];
const pair: PairEditorProps['pairs'][0] = {
enabled: true,
name: (name ?? '').trim(),
value: values.join(':').trim(),
value: (value ?? '').trim(),
};
return pair;
}