# zelvarys/zelvar-validate architecture

> Architecture diagram of the GitHub repository zelvarys/zelvar-validate, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zelvarys/zelvar-validate
- Repository: https://github.com/zelvarys/zelvar-validate

## Overview

zelvar-validate is a zero-dependency validation library. Consumers provide values and rules, then receive validity and error results through chainable, schema, conditional, async, nested, or batch APIs. The graph shows the main implementation calls and rule evaluations. README capabilities not fully visible in sampled source are represented only where the tree supports a module; the README excerpt ends before its remaining examples.

Main entry points: [`src/index.ts`](https://github.com/zelvarys/zelvar-validate/blob/main/src/index.ts) (Main Exports), [`src/browser.ts`](https://github.com/zelvarys/zelvar-validate/blob/main/src/browser.ts) (Browser Exports), [`src/validator.ts`](https://github.com/zelvarys/zelvar-validate/blob/main/src/validator.ts) (Chainable Validator), [`src/schema.ts`](https://github.com/zelvarys/zelvar-validate/blob/main/src/schema.ts) (Object Schemas)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public API"]
  node_entry["Main Exports<br/>[index.ts]"]
  node_browser["Browser Exports<br/>[browser.ts]"]
end

subgraph group_validation["Validation Core"]
  node_validator["Chainable Validator<br/>[validator.ts]"]
  node_rules["Built-in Rules<br/>[rules.ts]"]
  node_schema["Object Schemas<br/>[schema.ts]"]
end

subgraph group_extended["Validation Modes"]
  node_async["Async Validation<br/>[async.ts]"]
  node_conditional["Conditional Validation<br/>[conditional.ts]"]
  node_nested["Nested Validation<br/>[nested.ts]"]
  node_batch["Batch Validation<br/>[batch.ts]"]
end

node_consumer(("Library Consumer"))
node_result["Validation Results"]

node_consumer -->|"calls exports"| node_entry
node_consumer -->|"calls exports"| node_browser
node_entry -->|"exports"| node_validator
node_entry -->|"exports"| node_rules
node_entry -->|"exports"| node_schema
node_entry -->|"exports"| node_async
node_entry -->|"exports"| node_conditional
node_entry -->|"exports"| node_nested
node_entry -->|"exports"| node_batch
node_browser -->|"exports"| node_validator
node_browser -->|"exports"| node_schema
node_browser -->|"exports"| node_async
node_browser -->|"exports"| node_conditional
node_browser -->|"exports"| node_nested
node_browser -->|"exports"| node_batch
node_browser -->|"exports"| node_rules
node_validator -->|"evaluates rules"| node_rules
node_schema -->|"checks formats"| node_rules
node_nested -->|"validates with"| node_schema
node_async -->|"creates and runs"| node_validator
node_conditional -->|"creates and applies"| node_validator
node_batch -->|"creates and runs"| node_validator
node_validator -->|"returns status"| node_result
node_schema -->|"returns errors"| node_result
node_async -->|"returns status"| node_result
node_conditional -->|"returns status"| node_result
node_nested -->|"returns errors"| node_result
node_batch -->|"returns results"| node_result

click node_entry "https://github.com/zelvarys/zelvar-validate/blob/main/src/index.ts"
click node_browser "https://github.com/zelvarys/zelvar-validate/blob/main/src/browser.ts"
click node_validator "https://github.com/zelvarys/zelvar-validate/blob/main/src/validator.ts"
click node_rules "https://github.com/zelvarys/zelvar-validate/blob/main/src/rules.ts"
click node_schema "https://github.com/zelvarys/zelvar-validate/blob/main/src/schema.ts"
click node_async "https://github.com/zelvarys/zelvar-validate/blob/main/src/async.ts"
click node_conditional "https://github.com/zelvarys/zelvar-validate/blob/main/src/conditional.ts"
click node_nested "https://github.com/zelvarys/zelvar-validate/blob/main/src/nested.ts"
click node_batch "https://github.com/zelvarys/zelvar-validate/blob/main/src/batch.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_browser toneBlue
class node_validator,node_rules,node_schema toneAmber
class node_async,node_conditional,node_nested,node_batch toneMint
class node_consumer,node_result toneIndigo
```

## Components

### Public API

- [Main Exports](https://github.com/zelvarys/zelvar-validate/blob/main/src/index.ts): `src/index.ts`
- [Browser Exports](https://github.com/zelvarys/zelvar-validate/blob/main/src/browser.ts): `src/browser.ts`

### Validation Core

- [Chainable Validator](https://github.com/zelvarys/zelvar-validate/blob/main/src/validator.ts): `src/validator.ts`
- [Built-in Rules](https://github.com/zelvarys/zelvar-validate/blob/main/src/rules.ts): `src/rules.ts`
- [Object Schemas](https://github.com/zelvarys/zelvar-validate/blob/main/src/schema.ts): `src/schema.ts`

### Validation Modes

- [Async Validation](https://github.com/zelvarys/zelvar-validate/blob/main/src/async.ts): `src/async.ts`
- [Conditional Validation](https://github.com/zelvarys/zelvar-validate/blob/main/src/conditional.ts): `src/conditional.ts`
- [Nested Validation](https://github.com/zelvarys/zelvar-validate/blob/main/src/nested.ts): `src/nested.ts`
- [Batch Validation](https://github.com/zelvarys/zelvar-validate/blob/main/src/batch.ts): `src/batch.ts`

### Other components

- **Library Consumer**
- **Validation Results**

## Connections

- Library Consumer → Main Exports: calls exports
- Library Consumer → Browser Exports: calls exports
- Main Exports → Chainable Validator: exports
- Main Exports → Built-in Rules: exports
- Main Exports → Object Schemas: exports
- Main Exports → Async Validation: exports
- Main Exports → Conditional Validation: exports
- Main Exports → Nested Validation: exports
- Main Exports → Batch Validation: exports
- Browser Exports → Chainable Validator: exports
- Browser Exports → Object Schemas: exports
- Browser Exports → Async Validation: exports
- Browser Exports → Conditional Validation: exports
- Browser Exports → Nested Validation: exports
- Browser Exports → Batch Validation: exports
- Browser Exports → Built-in Rules: exports
- Chainable Validator → Built-in Rules: evaluates rules
- Object Schemas → Built-in Rules: checks formats
- Nested Validation → Object Schemas: validates with
- Async Validation → Chainable Validator: creates and runs
- Conditional Validation → Chainable Validator: creates and applies
- Batch Validation → Chainable Validator: creates and runs
- Chainable Validator → Validation Results: returns status
- Object Schemas → Validation Results: returns errors
- Async Validation → Validation Results: returns status
- Conditional Validation → Validation Results: returns status
- Nested Validation → Validation Results: returns errors
- Batch Validation → Validation Results: returns results
