# `JSONSchex.Compiler.Predicates`
[🔗](https://github.com/xinz/jsonschex/blob/main/lib/jsonschex/compiler/predicates.ex#L1)

Pure predicates for JSON Schema validation constraints.

All functions return `:ok` or `{:error, context}`. Non-applicable data types
pass validation (e.g., pattern checking on non-strings).

# `check_const`

```elixir
@spec check_const(term(), term()) :: :ok | {:error, map()}
```

Checks `const`.

# `check_enum`

```elixir
@spec check_enum(term(), list()) :: :ok | {:error, map()}
```

Checks `enum`.

# `check_exclusive_maximum`

Checks `exclusiveMaximum`.

# `check_exclusive_minimum`

Checks `exclusiveMinimum`.

# `check_max_items`

Checks `maxItems`.

# `check_max_length`

Checks `maxLength`.

# `check_max_properties`

Checks `maxProperties`.

# `check_maximum`

Checks `maximum`.

# `check_min_items`

Checks `minItems`.

# `check_min_length`

Checks `minLength`.

# `check_min_properties`

Checks `minProperties`.

# `check_minimum`

```elixir
@spec check_minimum(number(), number()) :: :ok | {:error, map()}
```

Checks `minimum`.

# `check_multiple_of`

Checks `multipleOf`.

# `check_pattern`

```elixir
@spec check_pattern(String.t(), Regex.t()) :: :ok | {:error, map()}
```

Checks `pattern`.

# `check_type`

```elixir
@spec check_type(term(), String.t()) :: :ok | {:error, map()}
```

Checks if data matches the specified JSON Schema type(s).

# `check_unique_items`

Checks `uniqueItems`. Uses `==` semantics (`1` equals `1.0`).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
