Skip to main content
Glama
defaultValueForValidator.test.ts552 B
import { defaultValueForValidator } from "./defaultValueForValidator"; describe("defaultValueForValidator", () => { it("should use `null` as a default value for `v.union()` (empty union / bottom type / never)", () => { const defaultValue = defaultValueForValidator({ type: "object", value: { neverField: { fieldType: { type: "union", value: [], }, optional: false, }, }, }); expect(defaultValue).toEqual({ neverField: null, }); }); });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/get-convex/convex-backend'

If you have feedback or need assistance with the MCP directory API, please join our Discord server