Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eyal-wowhub/contracts
A library that provides Design by Contract like APIs to ensure functions adhere to specific preconditions and postconditions.
https://github.com/eyal-wowhub/contracts
lib library lua world-of-warcraft world-of-warcraft-addon wow wow-addon
Last synced: about 16 hours ago
JSON representation
A library that provides Design by Contract like APIs to ensure functions adhere to specific preconditions and postconditions.
- Host: GitHub
- URL: https://github.com/eyal-wowhub/contracts
- Owner: Eyal-WowHub
- Created: 2025-01-02T16:11:40.000Z (7 days ago)
- Default Branch: main
- Last Pushed: 2025-01-04T21:39:42.000Z (5 days ago)
- Last Synced: 2025-01-05T14:39:15.001Z (4 days ago)
- Topics: lib, library, lua, world-of-warcraft, world-of-warcraft-addon, wow, wow-addon
- Language: Lua
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Contracts
A library that provides Design by Contract like APIs to ensure functions adhere to specific preconditions and postconditions.
#### Dependencies: [LibStub](https://www.curseforge.com/wow/addons/libstub)
### Example:
```lua
local C = LibStub("Contracts-1.0")local function Divide(numerator, denominator)
C:IsNumber(numerator, 1)
C:IsNumber(denominator, 2)
C:Ensures(denominator ~= 0, "Divided by zero. The denominator cannot be zero.")
return numerator / denominator
end
```