runtime assertions for typescript code
Find a file
clover caruso 98016cf117
All checks were successful
pr-checks / check (pull_request) Successful in 17s
chore: agent-focused coverage reporter
2026-01-25 23:43:02 -08:00
.forgejo/workflows chore: tiding + add root tsconfig 2025-12-27 19:17:14 -08:00
bin feat: node.js register and tsld-node binary 2026-01-25 01:12:10 -08:00
src feat: node.js register and tsld-node binary 2026-01-25 01:12:10 -08:00
test feat: node.js register and tsld-node binary 2026-01-25 01:12:10 -08:00
tools chore: agent-focused coverage reporter 2026-01-25 23:43:02 -08:00
.gitignore feat: type predicate and assertion signature verification 2025-12-24 17:05:57 -08:00
AGENTS.md feat: node.js register and tsld-node binary 2026-01-25 01:12:10 -08:00
coverage-baseline.json chore: agent-focused coverage reporter 2026-01-25 23:43:02 -08:00
dprint.jsonc chore: setup CI 2025-12-27 18:40:53 -08:00
package-lock.json feat: assert all function parameters 2025-12-28 15:49:24 -08:00
package.json feat: node.js register and tsld-node binary 2026-01-25 01:12:10 -08:00
readme.md feat: node.js register and tsld-node binary 2026-01-25 01:12:10 -08:00
tsconfig.json chore: tiding + add root tsconfig 2025-12-27 19:17:14 -08:00
vitest.config.ts chore: agent-focused coverage reporter 2026-01-25 23:43:02 -08:00

TypeScript Lie Detector

STATUS: Not ready for usage at all. Please monitor TSLD's Issue Tracker

A problem with current TypeScript is all types are given as-is, with no way to truly tell if those types are correct. Lie Detector instruments your codebase with many runtime checks to verify the soundness of your codebase.

Obvious sources of "lies" in TypeScript include the as clause and non-null assertions (postfix ! operator), but there are many many more places that types can pass but can fail at runtime. In many cases, proper type narrowing is better than having assertions, but narrowing system in TypeScript can only get so far.

Usage

TSLD is not currently published. If the repo is cloned, one can run npx tsld-node in place of node.js to lie-detect your code, like ts-node.

Contributions

This repository accepts pull requests to either its main repository on Forgejo as well as the GitHub Mirror. Until Forgejo has a federated issue tracker, bugs can be reported on GitHub Discussions or sent over email to git@paperclover.net