reclassifyFieldBySelector function infrastructure exported ✓ 100.0%
Last updated: 2026-03-04T23:21:38.391Z
Metrics
LOC: 9
Complexity: 3
Params: 2
Coverage: 100.0% (1/1 lines, 0x executed)
Signature
reclassifyFieldBySelector(
selector: string,
): : Promise<FormField | null>
Summary
Reclassifies a single field element identified by its CSS selector. Runs the full async pipeline (including Chrome AI) on just that one element. Returns null if the element is not found in the DOM.
Source Code
export async function reclassifyFieldBySelector(
selector: string,
): Promise<FormField | null> {
const element = document.querySelector<NativeElement>(selector);
if (!element) return null;
const field = buildNativeField(element);
const [classified] = await buildClassificationChain().runAsync([field]);
return classified ?? null;
}
Dependencies (Outgoing)
| Target | Type |
|---|---|
| buildNativeField | calls |
| buildClassificationChain | calls |
Impact (Incoming)
| Source | Type |
|---|---|
| FillableElement | uses |
| detectFormFields | uses |