Full API Reference
Quick catalog of every factory, modifier, method, and utility in Subatom Infer.
Schema Execution Methods
• .parse(data): Synchronous parse; throws ValidationError on error. • .safeParse(data): Synchronous parse; returns { success, data } or { success, error, issues }. • .parseAsync(data): Asynchronous parse; returns Promise<Output>. • .safeParseAsync(data) / .spa(data): Non-throwing asynchronous parse.
Primitive Factories
• infer.string(): min, max, length, email, url, httpUrl, uuid, cuid, cuid2, ulid, nanoid, regex, startsWith, endsWith, includes, datetime, date, time, duration, ipv4, ipv6, hostname, trim, toLowerCase, toUpperCase, normalize. • infer.number(): min, max, gt, gte, lt, lte, int, safe, finite, positive, nonnegative, negative, nonpositive, multipleOf. • infer.bigint(): min, max, gt, gte, lt, lte, positive, nonnegative, negative, nonpositive, multipleOf. • infer.boolean(), infer.date(). • infer.literal(val), infer.null(), infer.undefined(), infer.void(), infer.any(), infer.unknown(), infer.never(), infer.symbol(), infer.nan(). • infer.coerce: string, number, boolean, bigint, date.
Composite Factories
• infer.object(shape): strict, passthrough, strip, catchall, extend, merge, pick, omit, partial, required, deepPartial, keyof. • infer.array(schema): min, max, length, nonempty. • infer.tuple([s1, s2, ...]). • infer.set(schema): min, max, size, nonempty. • infer.map(keySchema, valSchema). • infer.record(keySchema, valSchema). • infer.enum(values), infer.nativeEnum(enumObj). • infer.union([s1, s2]), infer.discriminatedUnion(key, [s1, s2]). • infer.intersection(s1, s2), infer.lazy(fn).
Modifiers & Pipelines
• .optional(), .nullable(), .nullish(). • .default(val), .prefault(val). • .transform(fn), .pipe(schema). • .refine(fn, msg), .superRefine(fn). • .catch(fallback), .readonly(). • infer.brand(schema, name), infer.codec(decoder, encoder). • infer.file(), infer.files(), infer.function(), infer.promise().
