1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! Structure preservation operator for templating mode.
//!
//! The `preserve` operator is used when `preserve_structure` mode is enabled on the engine.
//! It allows literal values to pass through without being interpreted as operators,
//! enabling JSON templating where the output structure mirrors the input.
//!
//! # Use Case
//!
//! When processing JSON templates, you may want some object keys to be treated as
//! literal output fields rather than operators. The `preserve` operator marks these
//! values for pass-through.
//!
//! # Behavior
//!
//! - With no arguments: returns an empty array
//! - With one argument: evaluates and returns that argument
//! - With multiple arguments: returns an array of evaluated arguments
//!
//! # Example
//!
//! ```json
//! // With preserve_structure enabled, unknown keys become output fields
//! {
//! "name": {"var": "user.name"},
//! "status": "active"
//! }
//! // Output: {"name": "John", "status": "active"}
//! ```
use Value;
use crate::;
/// Preserve operator function - returns its argument unchanged