{"version":3,"file":"boolean.cjs","names":["BaseSchema"],"sources":["../../src/schemas/boolean.ts"],"sourcesContent":["import { BaseSchema } from \"../core/base\";\nimport type { CombinedStandardProps, SchemaPrimitive } from \"../core/types\";\n\nexport class BooleanSchemaType extends BaseSchema<unknown, boolean> {\n  readonly type: SchemaPrimitive = \"boolean\";\n\n  constructor() {\n    super();\n    this.jsonSchema = { type: \"boolean\" };\n  }\n\n  primitive(): SchemaPrimitive {\n    return this.type;\n  }\n\n  get [\"~standard\"](): CombinedStandardProps<unknown, boolean> {\n    return {\n      version: 1,\n      vendor: \"h-schema\",\n      jsonSchema: {\n        input: () => this.jsonSchema,\n        output: () => this.jsonSchema,\n      },\n      validate: (value: unknown) => {\n        if (this._coerce && typeof value !== \"boolean\") {\n          if (value === \"true\" || value === 1 || value === \"1\") {\n            value = true;\n          } else if (value === \"false\" || value === 0 || value === \"0\") {\n            value = false;\n          }\n        }\n        if (typeof value !== \"boolean\") {\n          return { issues: [{ message: `Expected boolean, received ${typeof value}` }] };\n        }\n        return { value };\n      },\n      types: {\n        input: {} as unknown,\n        output: {} as boolean,\n      },\n    };\n  }\n}\n"],"mappings":";;AAGA,IAAa,oBAAb,cAAuCA,aAAAA,WAA6B;CAClE,OAAiC;CAEjC,cAAc;EACZ,MAAM;EACN,KAAK,aAAa,EAAE,MAAM,UAAU;CACtC;CAEA,YAA6B;EAC3B,OAAO,KAAK;CACd;CAEA,KAAK,eAAwD;EAC3D,OAAO;GACL,SAAS;GACT,QAAQ;GACR,YAAY;IACV,aAAa,KAAK;IAClB,cAAc,KAAK;GACrB;GACA,WAAW,UAAmB;IAC5B,IAAI,KAAK,WAAW,OAAO,UAAU,WAC/B;SAAA,UAAU,UAAU,UAAU,KAAK,UAAU,KAC/C,QAAQ;UACH,IAAI,UAAU,WAAW,UAAU,KAAK,UAAU,KACvD,QAAQ;IAAA;IAGZ,IAAI,OAAO,UAAU,WACnB,OAAO,EAAE,QAAQ,CAAC,EAAE,SAAS,8BAA8B,OAAO,QAAQ,CAAC,EAAE;IAE/E,OAAO,EAAE,MAAM;GACjB;GACA,OAAO;IACL,OAAO,CAAC;IACR,QAAQ,CAAC;GACX;EACF;CACF;AACF"}