Files
skills/plugins/document-navigator/docs/foundation/bitpacker/bitpacker-validation/README.md
2026-06-09 21:06:27 +01:00

13 KiB

@suaveplan/bitpacker-validation - Bitpacker validation plugin

Summary

Safety limits and validation reports for bitpacker schemas.

Documentation tree

  • otel — (no submodules)
  • register-schemas — Idempotent integration with @suaveplan/schema-registry for the @suaveplan/bitpacker-validation package. Exposes `re…
    • register-schemas — Idempotent integration with @suaveplan/schema-registry for the @suaveplan/bitpacker-validation package. Exposes `re…
  • safety — (no submodules)
    • safety-checks — Production-time defensive checks against pathological inputs to the bitpacker — schemas with infinite recursion, arrays…
    • safety-checks.schema — Zod schemas for the configuration types of @suaveplan/bitpacker-validation's safety subsystem: SafetyLimits (the ab…
    • safety — (no submodules)
  • types — Public type companions for @suaveplan/bitpacker-validation: the validator options bundles, the error class, the error…
    • types — Public type companions for @suaveplan/bitpacker-validation: the validator options bundles, the error class, the error…
  • types.schema — Zod schemas for the two configuration shapes accepted by @suaveplan/bitpacker-validation's public surface: `BitPacker…
    • types.schema — Zod schemas for the two configuration shapes accepted by @suaveplan/bitpacker-validation's public surface: `BitPacker…
  • utils — Type guards and shape-checks shared across the @suaveplan/bitpacker-validation validators. These are the cheap, commo…
    • utils — Type guards and shape-checks shared across the @suaveplan/bitpacker-validation validators. These are the cheap, commo…
  • validation — (no submodules) - validator — Stateful validator for a fixed `BitPack…
    • find-array-length-errors — Per-array length-rule detector used by the recursive validateData walker. Given a BitPackerSchema array shape (`[sc…
    • find-extra-fields — Extra-field detector for the object-schema branch of the recursive validateData walker. Given a BitPackerSchema obj…
    • validate-data — The recursive workhorse that drives every validator entry point in @suaveplan/bitpacker-validation. `validateData(sch…
    • validation — (no submodules) - validator — Stateful validator for a fixed `BitPack…
    • validator — Stateful validator for a fixed BitPackerSchema. BitPackerValidator<T> is the right choice when a high-throughput pi…
  • index — Path: bitpacker-validation/src/index.ts Export: See source for details.
- [instruments](./src/otel/instruments.md) — _(no submodules)_- [safety](./src/safety/safety.md) — _(no submodules)_- [safety-checks](./src/safety/safety-checks.md) — Production-time defensive checks against pathological inputs to the bitpacker — schemas with infinite recursion, arrays…
  • safety-checks.schema — Zod schemas for the configuration types of @suaveplan/bitpacker-validation's safety subsystem: SafetyLimits (the ab…
  • safety — (no submodules)- validation — (no submodules)- validator — Stateful validator for a fixed `BitPack…
  • find-array-length-errors — Per-array length-rule detector used by the recursive validateData walker. Given a BitPackerSchema array shape (`[sc…
  • find-extra-fields — Extra-field detector for the object-schema branch of the recursive validateData walker. Given a BitPackerSchema obj…
  • validate-data — The recursive workhorse that drives every validator entry point in @suaveplan/bitpacker-validation. `validateData(sch…
  • validation — (no submodules)- validator — Stateful validator for a fixed `BitPack…
  • validator — Stateful validator for a fixed BitPackerSchema. BitPackerValidator<T> is the right choice when a high-throughput pi…
  • index — Path: bitpacker-validation/src/index.ts Export: See source for details.
  • register-schemas — Idempotent integration with @suaveplan/schema-registry for the @suaveplan/bitpacker-validation package. Exposes `re…
  • types — Public type companions for @suaveplan/bitpacker-validation: the validator options bundles, the error class, the error…
  • types.schema — Zod schemas for the two configuration shapes accepted by @suaveplan/bitpacker-validation's public surface: `BitPacker…
  • utils — Type guards and shape-checks shared across the @suaveplan/bitpacker-validation validators. These are the cheap, commo…
  • instruments — (no submodules)- safety — (no submodules)- safety-checks — Production-time defensive checks against pathological inputs to the bitpacker — schemas with infinite recursion, arrays…
    • safety-checks.schema — Zod schemas for the configuration types of @suaveplan/bitpacker-validation's safety subsystem: SafetyLimits (the ab…
    • safety — (no submodules)- validation — (no submodules)- validator — Stateful validator for a fixed `BitPack…
    • find-array-length-errors — Per-array length-rule detector used by the recursive validateData walker. Given a BitPackerSchema array shape (`[sc…
    • find-extra-fields — Extra-field detector for the object-schema branch of the recursive validateData walker. Given a BitPackerSchema obj…
    • validate-data — The recursive workhorse that drives every validator entry point in @suaveplan/bitpacker-validation. `validateData(sch…
    • validation — (no submodules)- validator — Stateful validator for a fixed `BitPack…
    • validator — Stateful validator for a fixed BitPackerSchema. BitPackerValidator<T> is the right choice when a high-throughput pi…
  • index — Path: bitpacker-validation/src/index.ts Export: See source for details.
  • register-schemas — Idempotent integration with @suaveplan/schema-registry for the @suaveplan/bitpacker-validation package. Exposes `re…
  • types — Public type companions for @suaveplan/bitpacker-validation: the validator options bundles, the error class, the error…
  • types.schema — Zod schemas for the two configuration shapes accepted by @suaveplan/bitpacker-validation's public surface: `BitPacker…
  • utils — Type guards and shape-checks shared across the @suaveplan/bitpacker-validation validators. These are the cheap, commo…
  • instruments — (no submodules)- safety — (no submodules)- safety-checks — Production-time defensive checks against pathological inputs to the bitpacker — schemas with infinite recursion, arrays…
    • safety-checks.schema — Zod schemas for the configuration types of @suaveplan/bitpacker-validation's safety subsystem: SafetyLimits (the ab…
    • safety — (no submodules)- validation — (no submodules)- validator — Stateful validator for a fixed `BitPack…
    • find-array-length-errors — Per-array length-rule detector used by the recursive validateData walker. Given a BitPackerSchema array shape (`[sc…
    • find-extra-fields — Extra-field detector for the object-schema branch of the recursive validateData walker. Given a BitPackerSchema obj…
    • validate-data — The recursive workhorse that drives every validator entry point in @suaveplan/bitpacker-validation. `validateData(sch…
    • validation — (no submodules)- validator — Stateful validator for a fixed `BitPack…
    • validator — Stateful validator for a fixed BitPackerSchema. BitPackerValidator<T> is the right choice when a high-throughput pi…
  • index — Path: bitpacker-validation/src/index.ts Export: See source for details.
  • register-schemas — Idempotent integration with @suaveplan/schema-registry for the @suaveplan/bitpacker-validation package. Exposes `re…
  • types — Public type companions for @suaveplan/bitpacker-validation: the validator options bundles, the error class, the error…
  • types.schema — Zod schemas for the two configuration shapes accepted by @suaveplan/bitpacker-validation's public surface: `BitPacker…
  • utils — Type guards and shape-checks shared across the @suaveplan/bitpacker-validation validators. These are the cheap, commo…
  • instruments — (no submodules)- safety — (no submodules) - safety-checks — Production-time defensive checks against pathological inputs to the bitpacker — schemas with infinite recursion, arrays…
    • safety-checks.schema — Zod schemas for the configuration types of @suaveplan/bitpacker-validation's safety subsystem: SafetyLimits (the ab…
    • safety — (no submodules)- validation — (no submodules) - find-array-length-errors — Per-array length-rule detector used by the recursive validateData walker. Given a BitPackerSchema array shape (`[sc…
    • find-extra-fields — Extra-field detector for the object-schema branch of the recursive validateData walker. Given a BitPackerSchema obj…
    • validate-data — The recursive workhorse that drives every validator entry point in @suaveplan/bitpacker-validation. `validateData(sch…
    • validation — (no submodules) - validator — Stateful validator for a fixed BitPackerSchema. BitPackerValidator<T> is the right choice when a high-throughput pi…
  • index — Path: bitpacker-validation/src/index.ts Export: See source for details.
  • register-schemas — Idempotent integration with @suaveplan/schema-registry for the @suaveplan/bitpacker-validation package. Exposes `re…
  • types — Public type companions for @suaveplan/bitpacker-validation: the validator options bundles, the error class, the error…
  • types.schema — Zod schemas for the two configuration shapes accepted by @suaveplan/bitpacker-validation's public surface: `BitPacker…
  • utils — Type guards and shape-checks shared across the @suaveplan/bitpacker-validation validators. These are the cheap, commo…

Install

bun add @suaveplan/bitpacker-validation

Usage

import { SafetyLimits, ValidationReport } from "@suaveplan/bitpacker-validation";

const limits = new SafetyLimits({ maxBits: 64, maxStringLength: 1024 });
const report = new ValidationReport();
report.addWarning("schema", "Large array may exceed budget");
report.addError("schema", "Unsupported type");

Modules

  • src/index.ts — SafetyLimits, ValidationReport