Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/bombshell-dev/configliere. A statically typed entry-point router for command-line applications
Something went wrong. Try again.
749 B · 27 lines
TypeScript
12345678910111213141516171819202122232425262728import type { StandardSchemaV1 } from "@standard-schema/spec";
export const optionalBoolean: StandardSchemaV1<boolean | undefined> = { "~standard": { version: 1, vendor: "configliere", validate(value): StandardSchemaV1.Result<boolean | undefined> { if (value === undefined || value === true || value === false) { return { value }; } return { issues: [{ message: `expected boolean, got ${typeof value}` }], }; }, },};
export const string: StandardSchemaV1<string> = { "~standard": { version: 1, vendor: "configliere", validate(value) { if (typeof value === "string") return { value }; return { issues: [{ message: "expected a command name" }] }; }, },};