What problem does it solve?
SchemaShield provides a CSP-safe, zero-runtime-code validator for JSON Schema, designed to prevent prototype pollution and remote references, while ensuring predictable performance in strict environments.
Core Features & Use Cases
- CSP-compliant, no eval or code generation, making it safe for strict environments and CSP policies.
- Stack-safe, with a flat interpreter to prevent recursion-related stack overflows in deeply nested payloads.
- Zero runtime dependencies and native support for runtime object validation (including class instances) with rich error reporting.
- Edge/Serverless ready and suitable for Cloudflare Workers, Vercel Edge Functions, Deno, or Bun environments.
- Immutable mode and configurable fail-fast behavior, plus extensibility via custom types, formats, and keywords.
Quick Start
Install SchemaShield, import it, and compile a schema with new SchemaShield().compile(schema) to validate data.