Skip to content
# Function: parseSqlFormatterOptions()

parseSqlFormatterOptions(value): SqlFormatterOptions

Defined in: packages/core/src/transformers/SqlFormatterOptionsParser.ts:95

Strictly parse untrusted input into formatter options.

This trust-boundary API accepts only plain objects, rejects unknown own keys and invalid values, omits undefined properties, and does not mutate its input. The existing SqlFormatter constructor remains the typed internal API and intentionally does not perform this strict check.

Parameters ​

value ​

unknown

External JSON, MCP, or configuration input.

Returns ​

SqlFormatterOptions

A validated copy that can be passed directly to SqlFormatter.

Throws ​

When the input shape, option name, or option value is invalid.

API output shape review: this boundary returns validated options rather than SQL or AST output, so it does not change formatter output or force reparsing.

Released under the MIT License.