LuaRocks.org had a security incident in September 2026. Read the incident report.

contract

A function argument type-checker.

$ luarocks install contract

This module checks whether or not arguments passed to a function satisfy a specified contract string. These strings define the argument type requirements for a given function using a custom mini-language. For example, "rt,n|s" represents a contract of one required table argument and one optional argument that can be either a number or a string.

Versions

1.2-15 years ago81 downloads
1.1-25 years ago41 downloads
1.1-16 years ago96 downloads
1.0-16 years ago(revision: 2)45 downloads
0.2-16 years ago(revision: 2)52 downloads

Dependencies

lua >= 5.1

Manifests