Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Freerange is a static analyzer that tracks possible numeric values through a supported subset of TypeScript code. It can flag risks such as division by zero, possible NaN or Infinity, and out-of-bounds array reads before the code runs. It is not a whole-program safety guarantee: its findings apply to code it can analyze, and its documentation identifies syntax and patterns it does not cover.

What Freerange does

Freerange infers ranges of numbers as it follows supported code paths. That lets it check whether a value used as a divisor could be zero, or whether an array index could fall outside the array’s valid bounds. It can also identify potential NaN and Infinity values.

The project uses the official TypeScript API and does not require a new language or annotations. Its documentation illustrates a grid calculation in which a 200-pixel container yields zero columns after division and flooring; dividing by that result later violates a nonzero-divisor requirement. This is an example from the project documentation, not a claim about a separately tested program. Freerange’s repository and documentation

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to run its checks

The project documents two commands for different tasks:

  • fr reports findings in the project.
  • fr --audit examines function contracts and offers refactoring suggestions, including help identifying unsupported code.

The documentation does not establish a universal installation procedure or guarantee compatibility with every TypeScript project, so consult the repository for current setup details before adding it to a build workflow.

What code it can analyze

Freerange deliberately targets a restricted subset rather than every valid TypeScript program. Its documented coverage includes named, synchronous, top-level functions; supported arithmetic and control flow; and selected uses of objects and arrays.

Rank #2
TypeScript Programming Language - Software Engineer & Coder T-Shirt
  • TypeScript implements a superset of syntax for strictly typed development, facilitating deep static analysis and enhanced development environment integration. The compiler translates source into standard script formats, ensuring parity across any runtime.
  • TypeScript is ideal for front-end developers, full-stack engineers, and software architects who build large-scale web applications. It serves those looking to improve code excellence, reduce bugs through static checking, and maintain complex projects more.
  • Lightweight, Classic fit, Double-needle sleeve and bottom hem

Several common patterns fall outside the stated coverage:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Imported function bodies are not analyzed.
  • Callbacks passed to higher-order functions are not analyzed.
  • Writes to objects and arrays are unsupported.
  • Other TypeScript patterns may be unsupported or only partially supported.

Because of those boundaries, a clean report means only that the analyzer found no issue in the code it successfully analyzed. It does not show that unexamined or unsupported behavior is safe. The audit command can help reveal unsupported code and suggest refactoring, but its presence does not expand every analysis to the entire program.

How to interpret range results

Freerange models JavaScript floating-point numbers, but it is not a general-purpose theorem prover. Its documentation says it merges the results of branches into continuous ranges, which can lose precision. Repeated calculations and transitive comparisons are among the patterns that may be less precise.

That makes Freerange most useful as a focused check on numeric assumptions within its supported subset—not as a substitute for tests, code review, or broader correctness checks. When a finding depends on a function contract or inferred requirement, inspect the relevant code and assumptions rather than treating the report as proof about paths the tool cannot see.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Why this matters for TypeScript code written with AI assistance

Bytes issue 506, dated July 24, 2026, frames Freerange around the hazards of agent-generated code: code can look plausible while relying on unsafe numeric assumptions. A range analyzer can make some of those assumptions visible during development, especially around divisors and array indices. The practical value still depends on whether the risky logic is in the subset Freerange understands. Bytes issue 506

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a team considering it, the key questions are whether its numeric checks address real risks in the codebase, whether important logic uses unsupported patterns, and whether the findings fit into the existing TypeScript workflow. The project documentation provides no head-to-head benchmark or basis for ranking Freerange against other analyzers.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.