# 🧑‍🎓 Custom rules

You can define your own `Predicates` , with entirely your own logic, or by composing other `Predicates`:

```typescript
const { asVerificable, isNumber, ensure } = require("verifica");

function isEvenNumber(verificable) {
    const number = ensure(verificable, isNumber);
    
    if (number % 2 !== 0) {
        return makeError(verificable, {
            type: "isEvenNumber",
        });
    }
    
    // return nothing = OK
}

function sayEvenNumber(number) {
    const vnumber = asVerificable(number);
    ensure(vnumber, isEvenNumber);
    
    console.log(`Number ${number} is even!`);
}
```
