TypeScript-first HAR 1.2 validation helpers.
har-validator is no longer supported. This package provides a dependency-free validation core for common HAR ingestion paths: structured issues, assertion errors, type guards, and promise wrappers for migration.
npm install har-guardimport { assertHar, validateHar } from "har-guard";
const result = validateHar(data);
if (!result.valid) {
console.error(result.issues);
}
assertHar(data);Returns { valid, issues, value }.
Throws HarValidationError when invalid.
Boolean type guard.
Validate common HAR fragments.
har(value), request(value), response(value), and entry(value) return a promise that resolves with the valid value or rejects with HarValidationError.
har-guard is an independent alternative or migration helper for projects moving away from har-validator. It is not affiliated with the original package maintainers or project.
For release context, see the local migration guide, examples, compatibility notes, source metadata, and adoption plan.