# Type Helpers (`types`)
AdonisJS-inspired runtime type guards and deep path access for JSON values.
## Features
- **Type guards**: `is_string`, `is_number`, `is_bool`, `is_array`, `is_object`, `is_null`
- **Deep equality**: `deep_equal`
- **Path access**: `get_path`, `set_path`
## Quick Start
```rust
use rok_utils::types::{is_string, is_number, is_array};
use serde_json::json;
let value = json!({"name": "Alice", "age": 30, "scores": [95, 87, 92]});
assert!(is_string(&value["name"]));
assert!(is_number(&value["age"]));
assert!(is_array(&value["scores"]));
```
## Deep Path Access
```rust
use rok_utils::types::get_path;
let data = json!({
"user": {
"address": {
"city": "New York"
}
}
});
assert_eq!(get_path(&data, "user.address.city"), Some(&json!("New York")));
assert_eq!(get_path(&data, "user.missing"), None);
```
## Deep Path Setting
```rust
use rok_utils::types::set_path;
let mut data = json!({"a": 1});
data = set_path(data, "b", json!(2));
assert_eq!(data.get("b"), Some(&json!(2)));
```
## Deep Equality
```rust
use rok_utils::types::deep_equal;
assert!(deep_equal(&json!({"a": 1}), &json!({"a": 1})));
assert!(!deep_equal(&json!({"a": 1}), &json!({"a": 2})));
```
## Feature Flags
| `full` | Enable all features |
| `json` | Enable JSON type guards and path access |
## See Also
- [Main examples](../docs/examples.md)