TypeScript runtime type system for IO decoding/encoding
72
A validation library for product data that validates multiple independent fields in parallel.
{ name: "Laptop", price: 999, quantity: 5 } @test{ name: "Laptop", price: 999, quantity: 5 } @test{ name: "Laptop", price: 999, quantity: 5 } when all fields are valid @test{ name: 123, price: "999", quantity: "5" } @test@generates
import { Either } from 'fp-ts/Either';
/**
* Validates a product name field independently
*/
export function validateName(input: unknown): Either<Error[], string>;
/**
* Validates a product price field independently
*/
export function validatePrice(input: unknown): Either<Error[], number>;
/**
* Validates a product quantity field independently
*/
export function validateQuantity(input: unknown): Either<Error[], number>;
/**
* Validates all product fields by combining independent validations
*/
export function validateProduct(input: unknown): Either<Error[], { name: string; price: number; quantity: number }>;Provides decoder composition for combining independent field validations.
@satisfied-by
Provides Either type for representing validation results.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-io-tsdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10