MCPcopy Create free account
hub / github.com/LibPDF-js/core / getOnValues

Method getOnValues

src/document/forms/fields/checkbox-field.ts:32–44  ·  view source on GitHub ↗

* Get all "on" values from widgets. * Single checkbox: one value (e.g., "Yes") * Group: multiple values (e.g., "Option1", "Option2")

()

Source from the content-addressed store, hash-verified

30 * Group: multiple values (e.g., "Option1", "Option2")
31 */
32 getOnValues(): string[] {
33 const values = new Set<string>();
34
35 for (const widget of this.getWidgets()) {
36 const onValue = widget.getOnValue();
37
38 if (onValue && onValue !== "Off") {
39 values.add(onValue);
40 }
41 }
42
43 return Array.from(values);
44 }
45
46 /**
47 * Get the primary "on" value (for single checkboxes).

Callers 3

isGroupMethod · 0.95
getOnValueMethod · 0.95
setValueMethod · 0.95

Calls 4

getWidgetsMethod · 0.80
fromMethod · 0.80
getOnValueMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected