MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / inputFields

Function inputFields

e2e/scenarios/google-disabled-api.test.ts:76–85  ·  view source on GitHub ↗
(html: string)

Source from the content-addressed store, hash-verified

74 .replaceAll(">", ">");
75
76const inputFields = (html: string): Record<string, string> => {
77 const fields: Record<string, string> = {};
78 for (const input of html.matchAll(/<input\b[^>]*>/gi)) {
79 const tag = input[0];
80 const name = tag.match(/\bname=["']([^"']+)["']/i)?.[1];
81 const value = tag.match(/\bvalue=["']([^"']*)["']/i)?.[1] ?? "";
82 if (name) fields[decodeHtml(name)] = decodeHtml(value);
83 }
84 return fields;
85};
86
87const formAction = (html: string, fallback: string): string => {
88 const action = html.match(/<form\b[^>]*\baction=["']([^"']+)["']/i)?.[1];

Callers 1

completeGoogleConsentFunction · 0.70

Calls 1

decodeHtmlFunction · 0.70

Tested by

no test coverage detected