@salesforce/b2c-tooling-sdk / docs / resolveEnabledCategories
Function: resolveEnabledCategories()
resolveEnabledCategories(
input,onInvalid?):DocCategory[] |undefined
Defined in: packages/b2c-tooling-sdk/src/docs/search.ts:142
Parses and validates a user-supplied set of documentation categories into a "topics" allowlist that bounds the entire available corpus (see SearchDocsOptions.enabledCategories). Accepts a comma-separated string or an array; names are trimmed and lower-cased.
Unknown names are dropped (and reported via onInvalid, if provided). Returns undefined when the input is empty or contains no valid categories, which means "no restriction" — matching the tolerant behavior of the MCP --toolsets flag, so a typo yields a warning and the full corpus rather than a dead tool.
Parameters
input
Comma-separated category names, or an array of names
string | readonly string[] | undefined
onInvalid?
(invalid) => void
Optional callback invoked with any unrecognized names
Returns
DocCategory[] | undefined
The validated, de-duplicated categories, or undefined for no restriction