awesome-repositories.com
博客
MCP
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
sindresorhus avatar

sindresorhus/ow

0
View on GitHub↗
3,868 星标·110 分支·TypeScript·MIT·8 次浏览sindresorhus.com/ow↗

Ow

ow is a type-safe schema validation library for TypeScript that verifies data integrity at runtime. It functions as a runtime validation framework and type guard utility, ensuring that JavaScript values match expected types and schemas before they are processed.

The library synchronizes runtime data checks with static TypeScript type definitions, allowing users to extract type definitions directly from validation predicates. This integration enables type narrowing, where a successful validation result refines the variable type for safer usage in the code.

The framework uses a chainable API to build verification logic for function arguments and object shapes. It supports the composition of complex predicates using logical operators, the definition of reusable validators, and the customization of error messages. Support is included for validating primitives, built-in objects, and typed arrays.

Features

  • Runtime Schema Validations - Verifies that JavaScript values match expected TypeScript types and schemas during runtime execution.
  • Predicate Composers - Combines multiple validation rules using logical operators to create sophisticated constraints for data.
  • Runtime Validation Libraries - Provides runtime data verification combined with automatic TypeScript type inference.
  • Type Narrowing - Tests values against predicates to refine the TypeScript type upon a successful match.
  • Type Narrowing Assertion - Refines TypeScript types by linking runtime validation success to static type guards for safer variable usage.
  • Type Validation - Provides runtime checking to ensure values match specific types, including primitives and built-in objects.
  • Data Schema Enforcement - Enforces complex rules and requirements for objects and primitives to catch malformed information early in the application flow.
  • Object Shape Validation - Enforces specific property requirements and types on objects while supporting partial updates.
  • Type-Safe Schema Validators - Synchronizes runtime data checks with static TypeScript type definitions to ensure type safety during validation.
  • Function Argument Validation - Verifies that inputs passed to functions meet specific type constraints and requirements at runtime.
  • Logical Predicate Composition - Combines individual validation functions using logical operators to create sophisticated requirements for complex data structures.
  • Chainable Validation APIs - Uses a chainable API to build complex validation logic through incrementally refined method calls.
  • Single Value Validators - Verifies that a single value matches a specific predicate and triggers an error upon failure.
  • Schema Type Inference - Automatically extracts TypeScript type definitions from runtime predicates to ensure consistency without duplicating code.
  • Runtime Type Guards - Provides runtime boolean checks that automatically narrow TypeScript types upon a successful match.
  • Build-Time Code Stripping - Implements environment-aware markers to strip validation logic from production bundles to reduce final application size.
  • Predicate Combinations - Allows combining several constraints to require a minimum number of matches or invert the result of a rule.
  • Predicate Match Verification - Returns a boolean indicating whether a value satisfies a predicate without triggering an exception.
  • Fluent Validation APIs - Uses a chainable, fluent API to build complex verification logic for function arguments and object shapes.
  • Custom Validation Functions - Executes custom synchronous or asynchronous validation logic with support for specific error messages.
  • Function Registries - Provides a registry mechanism to map identifiers to reusable standalone validation functions.
  • Composable Validation Frameworks - Implements a framework for creating reusable, composable predicates and custom error messages for complex data verification.
  • Explicit Nullable Validators - Allows specifying whether values can be undefined or null without triggering validation errors.
  • Validation Error Customizations - Provides mechanisms for overriding default error messages with specific text or dynamic functions.
  • Reusable Validators - Enables the definition of reusable validation rules with custom labels to maintain consistency across projects.
  • Runtime Validation - Human-readable function argument validation.

Star 历史

sindresorhus/ow 的 Star 历史图表sindresorhus/ow 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

常见问题解答

sindresorhus/ow 是做什么的?

ow is a type-safe schema validation library for TypeScript that verifies data integrity at runtime. It functions as a runtime validation framework and type guard utility, ensuring that JavaScript values match expected types and schemas before they are processed.

sindresorhus/ow 的主要功能有哪些?

sindresorhus/ow 的主要功能包括:Runtime Schema Validations, Predicate Composers, Runtime Validation Libraries, Type Narrowing, Type Narrowing Assertion, Type Validation, Data Schema Enforcement, Object Shape Validation。

sindresorhus/ow 有哪些开源替代品?

sindresorhus/ow 的开源替代品包括: samchon/typia — Typia is a compile-time code generator that transforms TypeScript type annotations into runtime validation,… yiminghe/async-validator — async-validator is a JavaScript schema validation library and asynchronous data validation engine. It verifies complex… meteor-community-packages/meteor-simple-schema — This library provides a comprehensive system for defining data schemas and enforcing structural integrity within… asaskevich/govalidator — [Go] Package of validators and sanitizers for strings, numerics, slices and structs. json-schema-form/angular-schema-form — Angular schema form is a framework directive and form component library that automatically generates and validates… php-standard-library/php-standard-library — The php-standard-library is a comprehensive toolkit for functional programming and asynchronous networking in PHP,…

Ow 的开源替代方案

相似的开源项目,按与 Ow 的功能重合度排序。
  • samchon/typiasamchon 的头像

    samchon/typia

    5,837在 GitHub 上查看↗

    Typia is a compile-time code generator that transforms TypeScript type annotations into runtime validation, serialization, and schema functions without requiring decorators or separate schema files. It generates optimized validation and serialization code during TypeScript compilation, producing dedicated functions for each type that eliminate runtime schema objects for faster execution. The project extends this core capability into several integrated areas. It generates fully typed client SDKs from NestJS controller source code, keeping server and client types synchronized automatically. It

    Go
    在 GitHub 上查看↗5,837
  • yiminghe/async-validatoryiminghe 的头像

    yiminghe/async-validator

    9,099在 GitHub 上查看↗

    async-validator is a JavaScript schema validation library and asynchronous data validation engine. It verifies complex object structures and nested arrays by applying recursive rules and non-blocking, promise-based execution to ensure data integrity. The library functions as both an object constraint validator and a data transformation pipeline. It allows for the sanitization, coercion, and formatting of input values through a sequence of functions that run before and after the primary validation process. The engine covers a range of capabilities including recursive nested validation, the en

    TypeScript
    在 GitHub 上查看↗9,099
  • meteor-community-packages/meteor-simple-schemaMeteor-Community-Packages 的头像

    Meteor-Community-Packages/meteor-simple-schema

    915在 GitHub 上查看↗

    This library provides a comprehensive system for defining data schemas and enforcing structural integrity within JavaScript applications. It enables developers to construct declarative rules for complex, nested objects, ensuring that data conforms to expected types and constraints before it is processed or stored. By integrating directly with the Meteor framework, it serves as a central tool for maintaining consistent data structures across collections and remote procedure calls. The project distinguishes itself through its deep integration with reactive data systems, allowing validation stat

    JavaScriptcleaning-dataform-generationform-validation
    在 GitHub 上查看↗915
  • asaskevich/govalidatorasaskevich 的头像

    asaskevich/govalidator

    6,203在 GitHub 上查看↗

    Go Package of validators and sanitizers for strings, numerics, slices and structs

    Gogogovalidatorsanitization
    在 GitHub 上查看↗6,203
  • 查看 Ow 的所有 30 个替代方案→