You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: protocol.md
+31-3Lines changed: 31 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Non-JSON types are encoded using arrays. The first element of the array contains
12
12
["date", 1749342170815]
13
13
```
14
14
15
-
To encode a literal array, the array must be "escaped" by wrapping it in a second layer of array:
15
+
To encode an array, the array must be wrapped in a second layer of array to create an array expression:
16
16
17
17
```
18
18
[["just", "an", "array"]]
@@ -100,7 +100,35 @@ Expressions are JSON-serializable object trees. All JSON types except arrays are
100
100
101
101
`[[...]]`
102
102
103
-
A single-element array containing another array is an escape sequence. The inner array is to be interpreted literally. (Its elements are still individually evaluated.)
103
+
An array expression. The inner array contains expressions (one for each array element), which are individually evaluated to produce the final array value.
104
+
105
+
For example, this expression represents an object containing an array:
106
+
107
+
```
108
+
{
109
+
"key": [[
110
+
"abc",
111
+
["date", 1757214689123],
112
+
[[0]]
113
+
]]
114
+
}
115
+
```
116
+
117
+
This is an expression which will evaluate to an object. The expression representing the value of the "key" field is an array expression.
118
+
- The 1st item in the array expression is an expression for the string "abc"
119
+
- The 2nd item is an expression for a date object
120
+
- The 3rd item is another array expression containing an integer expression representing zero.
121
+
122
+
This expression will evaluate to the following object:
123
+
```
124
+
{
125
+
"key": [
126
+
"abc",
127
+
Date(1757214689123),
128
+
[0]
129
+
]
130
+
}
131
+
```
104
132
105
133
`["date", number]`
106
134
@@ -121,7 +149,7 @@ If the type is "import", the expression evaluates to a stub. If it is "pipeline"
121
149
122
150
`propertyPath` is optional. If specified, it is an array of property names (strings or numbers) leading to a specific property of the import's target. The expression evaluates to that property (unless `callArguments` is also specified).
123
151
124
-
`callArguments` is also optional. If specified, then the given property should be called as a function. `callArguments` is an expression that evaluates to an array; these are the arguments to the call.
152
+
`callArguments` is also optional. If specified, then the given property should be called as a function. `callArguments` is an array of expressions; these expressions are evaluated to produce the arguments to the call.
0 commit comments