@player-ui/player 0.8.0--canary.307.9621 → 0.8.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/dist/Player.native.js +11630 -0
  2. package/dist/Player.native.js.map +1 -0
  3. package/dist/cjs/index.cjs +5626 -0
  4. package/dist/cjs/index.cjs.map +1 -0
  5. package/dist/{index.esm.js → index.legacy-esm.js} +2044 -1667
  6. package/dist/{index.cjs.js → index.mjs} +2052 -1761
  7. package/dist/index.mjs.map +1 -0
  8. package/package.json +29 -63
  9. package/src/__tests__/data.test.ts +498 -0
  10. package/src/__tests__/flow.test.ts +312 -0
  11. package/src/__tests__/helpers/action-exp.plugin.ts +22 -0
  12. package/src/__tests__/helpers/actions.flow.ts +67 -0
  13. package/src/__tests__/helpers/binding.plugin.ts +125 -0
  14. package/src/__tests__/helpers/expression.plugin.ts +88 -0
  15. package/src/__tests__/helpers/transform-plugin.ts +19 -0
  16. package/src/__tests__/helpers/validation.flow.ts +56 -0
  17. package/src/__tests__/player.test.ts +597 -0
  18. package/src/__tests__/string-resolver.test.ts +186 -0
  19. package/src/__tests__/validation.test.ts +3555 -0
  20. package/src/__tests__/view.test.ts +715 -0
  21. package/src/binding/__tests__/binding.test.ts +113 -0
  22. package/src/binding/__tests__/index.test.ts +208 -0
  23. package/src/binding/__tests__/resolver.test.ts +83 -0
  24. package/src/binding/binding.ts +6 -6
  25. package/src/binding/index.ts +34 -34
  26. package/src/binding/resolver.ts +19 -19
  27. package/src/binding/utils.ts +7 -7
  28. package/src/binding-grammar/__tests__/parser.test.ts +64 -0
  29. package/src/binding-grammar/__tests__/test-utils/ast-cases.ts +198 -0
  30. package/src/binding-grammar/__tests__/test-utils/perf-test.ts +66 -0
  31. package/src/binding-grammar/ast.ts +11 -11
  32. package/src/binding-grammar/custom/index.ts +19 -22
  33. package/src/binding-grammar/ebnf/index.ts +20 -21
  34. package/src/binding-grammar/ebnf/types.ts +13 -13
  35. package/src/binding-grammar/index.ts +4 -4
  36. package/src/binding-grammar/parsimmon/index.ts +14 -14
  37. package/src/controllers/constants/__tests__/index.test.ts +106 -0
  38. package/src/controllers/constants/index.ts +3 -3
  39. package/src/controllers/constants/utils.ts +4 -4
  40. package/src/controllers/data/controller.ts +22 -22
  41. package/src/controllers/data/index.ts +1 -1
  42. package/src/controllers/data/utils.ts +7 -7
  43. package/src/controllers/flow/__tests__/controller.test.ts +195 -0
  44. package/src/controllers/flow/__tests__/flow.test.ts +381 -0
  45. package/src/controllers/flow/controller.ts +13 -13
  46. package/src/controllers/flow/flow.ts +23 -23
  47. package/src/controllers/flow/index.ts +2 -2
  48. package/src/controllers/index.ts +5 -5
  49. package/src/controllers/validation/binding-tracker.ts +71 -59
  50. package/src/controllers/validation/controller.ts +104 -104
  51. package/src/controllers/validation/index.ts +2 -2
  52. package/src/controllers/view/asset-transform.ts +20 -20
  53. package/src/controllers/view/controller.ts +27 -27
  54. package/src/controllers/view/index.ts +4 -4
  55. package/src/controllers/view/store.ts +3 -3
  56. package/src/controllers/view/types.ts +7 -7
  57. package/src/data/__tests__/__snapshots__/dependency-tracker.test.ts.snap +64 -0
  58. package/src/data/__tests__/dependency-tracker.test.ts +146 -0
  59. package/src/data/__tests__/local-model.test.ts +46 -0
  60. package/src/data/__tests__/model.test.ts +78 -0
  61. package/src/data/dependency-tracker.ts +16 -16
  62. package/src/data/index.ts +4 -4
  63. package/src/data/local-model.ts +6 -6
  64. package/src/data/model.ts +17 -17
  65. package/src/data/noop-model.ts +1 -1
  66. package/src/expressions/__tests__/__snapshots__/parser.test.ts.snap +854 -0
  67. package/src/expressions/__tests__/evaluator-functions.test.ts +47 -0
  68. package/src/expressions/__tests__/evaluator.test.ts +410 -0
  69. package/src/expressions/__tests__/parser.test.ts +115 -0
  70. package/src/expressions/__tests__/utils.test.ts +44 -0
  71. package/src/expressions/evaluator-functions.ts +6 -6
  72. package/src/expressions/evaluator.ts +71 -67
  73. package/src/expressions/index.ts +4 -4
  74. package/src/expressions/parser.ts +102 -105
  75. package/src/expressions/types.ts +29 -21
  76. package/src/expressions/utils.ts +32 -21
  77. package/src/index.ts +13 -13
  78. package/src/logger/__tests__/consoleLogger.test.ts +46 -0
  79. package/src/logger/__tests__/noopLogger.test.ts +13 -0
  80. package/src/logger/__tests__/proxyLogger.test.ts +31 -0
  81. package/src/logger/__tests__/tapableLogger.test.ts +41 -0
  82. package/src/logger/consoleLogger.ts +9 -9
  83. package/src/logger/index.ts +5 -5
  84. package/src/logger/noopLogger.ts +1 -1
  85. package/src/logger/proxyLogger.ts +6 -6
  86. package/src/logger/tapableLogger.ts +7 -7
  87. package/src/logger/types.ts +2 -2
  88. package/src/player.ts +60 -58
  89. package/src/plugins/default-exp-plugin.ts +10 -10
  90. package/src/plugins/default-view-plugin.ts +29 -0
  91. package/src/plugins/flow-exp-plugin.ts +6 -6
  92. package/src/schema/__tests__/schema.test.ts +243 -0
  93. package/src/schema/index.ts +2 -2
  94. package/src/schema/schema.ts +24 -24
  95. package/src/schema/types.ts +4 -4
  96. package/src/string-resolver/__tests__/index.test.ts +361 -0
  97. package/src/string-resolver/index.ts +17 -17
  98. package/src/types.ts +17 -17
  99. package/src/utils/__tests__/replaceParams.test.ts +33 -0
  100. package/src/utils/index.ts +1 -1
  101. package/src/utils/replaceParams.ts +1 -1
  102. package/src/validator/__tests__/binding-map-splice.test.ts +53 -0
  103. package/src/validator/__tests__/validation-middleware.test.ts +127 -0
  104. package/src/validator/binding-map-splice.ts +5 -5
  105. package/src/validator/index.ts +4 -4
  106. package/src/validator/registry.ts +1 -1
  107. package/src/validator/types.ts +13 -13
  108. package/src/validator/validation-middleware.ts +15 -15
  109. package/src/view/__tests__/view.immutable.test.ts +269 -0
  110. package/src/view/__tests__/view.test.ts +959 -0
  111. package/src/view/builder/index.test.ts +69 -0
  112. package/src/view/builder/index.ts +3 -3
  113. package/src/view/index.ts +5 -5
  114. package/src/view/parser/__tests__/__snapshots__/parser.test.ts.snap +394 -0
  115. package/src/view/parser/__tests__/parser.test.ts +264 -0
  116. package/src/view/parser/index.ts +43 -33
  117. package/src/view/parser/types.ts +11 -11
  118. package/src/view/parser/utils.ts +5 -5
  119. package/src/view/plugins/__tests__/__snapshots__/template.test.ts.snap +278 -0
  120. package/src/view/plugins/__tests__/applicability.test.ts +265 -0
  121. package/src/view/plugins/__tests__/string.test.ts +122 -0
  122. package/src/view/plugins/__tests__/template.test.ts +724 -0
  123. package/src/view/plugins/applicability.ts +19 -19
  124. package/src/view/plugins/index.ts +4 -5
  125. package/src/view/plugins/options.ts +1 -1
  126. package/src/view/plugins/string-resolver.ts +22 -22
  127. package/src/view/plugins/switch.ts +22 -23
  128. package/src/view/plugins/template-plugin.ts +26 -27
  129. package/src/view/resolver/__tests__/dependencies.test.ts +321 -0
  130. package/src/view/resolver/__tests__/edgecases.test.ts +626 -0
  131. package/src/view/resolver/index.ts +42 -42
  132. package/src/view/resolver/types.ts +21 -20
  133. package/src/view/resolver/utils.ts +9 -9
  134. package/src/view/view.ts +32 -22
  135. package/types/binding/binding.d.ts +50 -0
  136. package/types/binding/index.d.ts +29 -0
  137. package/types/binding/resolver.d.ts +26 -0
  138. package/types/binding/utils.d.ts +12 -0
  139. package/types/binding-grammar/ast.d.ts +67 -0
  140. package/types/binding-grammar/custom/index.d.ts +4 -0
  141. package/types/binding-grammar/ebnf/index.d.ts +4 -0
  142. package/types/binding-grammar/ebnf/types.d.ts +75 -0
  143. package/types/binding-grammar/index.d.ts +5 -0
  144. package/types/binding-grammar/parsimmon/index.d.ts +4 -0
  145. package/types/controllers/constants/index.d.ts +45 -0
  146. package/types/controllers/constants/utils.d.ts +6 -0
  147. package/types/controllers/data/controller.d.ts +45 -0
  148. package/types/controllers/data/index.d.ts +2 -0
  149. package/types/controllers/data/utils.d.ts +14 -0
  150. package/types/controllers/flow/controller.d.ts +25 -0
  151. package/types/controllers/flow/flow.d.ts +50 -0
  152. package/types/controllers/flow/index.d.ts +3 -0
  153. package/types/controllers/index.d.ts +6 -0
  154. package/types/controllers/validation/binding-tracker.d.ts +32 -0
  155. package/types/controllers/validation/controller.d.ts +151 -0
  156. package/types/controllers/validation/index.d.ts +3 -0
  157. package/types/controllers/view/asset-transform.d.ts +19 -0
  158. package/types/controllers/view/controller.d.ts +37 -0
  159. package/types/controllers/view/index.d.ts +5 -0
  160. package/types/controllers/view/store.d.ts +20 -0
  161. package/types/controllers/view/types.d.ts +16 -0
  162. package/types/data/dependency-tracker.d.ts +49 -0
  163. package/types/data/index.d.ts +5 -0
  164. package/types/data/local-model.d.ts +16 -0
  165. package/types/data/model.d.ts +86 -0
  166. package/types/data/noop-model.d.ts +13 -0
  167. package/types/expressions/evaluator-functions.d.ts +15 -0
  168. package/types/expressions/evaluator.d.ts +52 -0
  169. package/types/expressions/index.d.ts +5 -0
  170. package/types/expressions/parser.d.ts +10 -0
  171. package/types/expressions/types.d.ts +144 -0
  172. package/types/expressions/utils.d.ts +12 -0
  173. package/types/index.d.ts +14 -0
  174. package/types/logger/consoleLogger.d.ts +17 -0
  175. package/types/logger/index.d.ts +6 -0
  176. package/types/logger/noopLogger.d.ts +10 -0
  177. package/types/logger/proxyLogger.d.ts +15 -0
  178. package/types/logger/tapableLogger.d.ts +23 -0
  179. package/types/logger/types.d.ts +6 -0
  180. package/types/player.d.ts +101 -0
  181. package/types/plugins/default-exp-plugin.d.ts +9 -0
  182. package/types/plugins/default-view-plugin.d.ts +9 -0
  183. package/types/plugins/flow-exp-plugin.d.ts +11 -0
  184. package/types/schema/index.d.ts +3 -0
  185. package/types/schema/schema.d.ts +36 -0
  186. package/types/schema/types.d.ts +38 -0
  187. package/types/string-resolver/index.d.ts +30 -0
  188. package/types/types.d.ts +73 -0
  189. package/types/utils/index.d.ts +2 -0
  190. package/types/utils/replaceParams.d.ts +9 -0
  191. package/types/validator/binding-map-splice.d.ts +10 -0
  192. package/types/validator/index.d.ts +5 -0
  193. package/types/validator/registry.d.ts +11 -0
  194. package/types/validator/types.d.ts +53 -0
  195. package/types/validator/validation-middleware.d.ts +36 -0
  196. package/types/view/builder/index.d.ts +35 -0
  197. package/types/view/index.d.ts +6 -0
  198. package/types/view/parser/index.d.ts +52 -0
  199. package/types/view/parser/types.d.ts +109 -0
  200. package/types/view/parser/utils.d.ts +6 -0
  201. package/types/view/plugins/applicability.d.ts +10 -0
  202. package/types/view/plugins/index.d.ts +5 -0
  203. package/types/view/plugins/options.d.ts +4 -0
  204. package/types/view/plugins/string-resolver.d.ts +13 -0
  205. package/types/view/plugins/switch.d.ts +14 -0
  206. package/types/view/plugins/template-plugin.d.ts +33 -0
  207. package/types/view/resolver/index.d.ts +73 -0
  208. package/types/view/resolver/types.d.ts +129 -0
  209. package/types/view/resolver/utils.d.ts +11 -0
  210. package/types/view/view.d.ts +37 -0
  211. package/dist/index.d.ts +0 -1814
  212. package/dist/player.dev.js +0 -11472
  213. package/dist/player.prod.js +0 -2
  214. package/src/view/plugins/plugin.ts +0 -21
@@ -0,0 +1,854 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`expression parser > objects- in parser 1`] = `
4
+ {
5
+ "__id": Symbol(Expression Node ID),
6
+ "attributes": [
7
+ {
8
+ "key": {
9
+ "__id": Symbol(Expression Node ID),
10
+ "location": {
11
+ "end": {
12
+ "character": 6,
13
+ },
14
+ "start": {
15
+ "character": 2,
16
+ },
17
+ },
18
+ "raw": ""foo"",
19
+ "type": "Literal",
20
+ "value": "foo",
21
+ },
22
+ "value": {
23
+ "__id": Symbol(Expression Node ID),
24
+ "location": {
25
+ "end": {
26
+ "character": 15,
27
+ },
28
+ "start": {
29
+ "character": 9,
30
+ },
31
+ },
32
+ "raw": ""value"",
33
+ "type": "Literal",
34
+ "value": "value",
35
+ },
36
+ },
37
+ ],
38
+ "location": {
39
+ "end": {
40
+ "character": 16,
41
+ },
42
+ "start": {
43
+ "character": 0,
44
+ },
45
+ },
46
+ "type": "Object",
47
+ }
48
+ `;
49
+
50
+ exports[`expression parser > objects- in parser 2`] = `
51
+ {
52
+ "__id": Symbol(Expression Node ID),
53
+ "attributes": [
54
+ {
55
+ "key": {
56
+ "__id": Symbol(Expression Node ID),
57
+ "location": {
58
+ "end": {
59
+ "character": 6,
60
+ },
61
+ "start": {
62
+ "character": 2,
63
+ },
64
+ },
65
+ "raw": ""foo"",
66
+ "type": "Literal",
67
+ "value": "foo",
68
+ },
69
+ "value": {
70
+ "__id": Symbol(Expression Node ID),
71
+ "location": {
72
+ "end": {
73
+ "character": 24,
74
+ },
75
+ "start": {
76
+ "character": 8,
77
+ },
78
+ },
79
+ "ref": "some.binding",
80
+ "type": "ModelRef",
81
+ },
82
+ },
83
+ ],
84
+ "location": {
85
+ "end": {
86
+ "character": 25,
87
+ },
88
+ "start": {
89
+ "character": 0,
90
+ },
91
+ },
92
+ "type": "Object",
93
+ }
94
+ `;
95
+
96
+ exports[`expression parser > objects- in parser 3`] = `
97
+ {
98
+ "__id": Symbol(Expression Node ID),
99
+ "attributes": [
100
+ {
101
+ "key": {
102
+ "__id": Symbol(Expression Node ID),
103
+ "location": {
104
+ "end": {
105
+ "character": 6,
106
+ },
107
+ "start": {
108
+ "character": 2,
109
+ },
110
+ },
111
+ "raw": ""foo"",
112
+ "type": "Literal",
113
+ "value": "foo",
114
+ },
115
+ "value": {
116
+ "__id": Symbol(Expression Node ID),
117
+ "left": {
118
+ "__id": Symbol(Expression Node ID),
119
+ "location": {
120
+ "end": {
121
+ "character": 9,
122
+ },
123
+ "start": {
124
+ "character": 8,
125
+ },
126
+ },
127
+ "raw": "1",
128
+ "type": "Literal",
129
+ "value": 1,
130
+ },
131
+ "location": {
132
+ "end": {
133
+ "character": 13,
134
+ },
135
+ "start": {
136
+ "character": 8,
137
+ },
138
+ },
139
+ "operator": "+",
140
+ "right": {
141
+ "__id": Symbol(Expression Node ID),
142
+ "location": {
143
+ "end": {
144
+ "character": 13,
145
+ },
146
+ "start": {
147
+ "character": 12,
148
+ },
149
+ },
150
+ "raw": "2",
151
+ "type": "Literal",
152
+ "value": 2,
153
+ },
154
+ "type": "BinaryExpression",
155
+ },
156
+ },
157
+ ],
158
+ "location": {
159
+ "end": {
160
+ "character": 14,
161
+ },
162
+ "start": {
163
+ "character": 0,
164
+ },
165
+ },
166
+ "type": "Object",
167
+ }
168
+ `;
169
+
170
+ exports[`expression parser > objects- in parser 4`] = `
171
+ {
172
+ "__id": Symbol(Expression Node ID),
173
+ "attributes": [
174
+ {
175
+ "key": {
176
+ "__id": Symbol(Expression Node ID),
177
+ "location": {
178
+ "end": {
179
+ "character": 6,
180
+ },
181
+ "start": {
182
+ "character": 2,
183
+ },
184
+ },
185
+ "raw": ""foo"",
186
+ "type": "Literal",
187
+ "value": "foo",
188
+ },
189
+ "value": {
190
+ "__id": Symbol(Expression Node ID),
191
+ "location": {
192
+ "end": {
193
+ "character": 15,
194
+ },
195
+ "start": {
196
+ "character": 9,
197
+ },
198
+ },
199
+ "raw": ""value"",
200
+ "type": "Literal",
201
+ "value": "value",
202
+ },
203
+ },
204
+ {
205
+ "key": {
206
+ "__id": Symbol(Expression Node ID),
207
+ "location": {
208
+ "end": {
209
+ "character": 22,
210
+ },
211
+ "start": {
212
+ "character": 18,
213
+ },
214
+ },
215
+ "raw": ""bar"",
216
+ "type": "Literal",
217
+ "value": "bar",
218
+ },
219
+ "value": {
220
+ "__id": Symbol(Expression Node ID),
221
+ "location": {
222
+ "end": {
223
+ "character": 29,
224
+ },
225
+ "start": {
226
+ "character": 25,
227
+ },
228
+ },
229
+ "raw": ""baz"",
230
+ "type": "Literal",
231
+ "value": "baz",
232
+ },
233
+ },
234
+ ],
235
+ "location": {
236
+ "end": {
237
+ "character": 30,
238
+ },
239
+ "start": {
240
+ "character": 0,
241
+ },
242
+ },
243
+ "type": "Object",
244
+ }
245
+ `;
246
+
247
+ exports[`expression parser > objects- in parser 5`] = `
248
+ {
249
+ "__id": Symbol(Expression Node ID),
250
+ "attributes": [
251
+ {
252
+ "key": {
253
+ "__id": Symbol(Expression Node ID),
254
+ "location": {
255
+ "end": {
256
+ "character": 6,
257
+ },
258
+ "start": {
259
+ "character": 2,
260
+ },
261
+ },
262
+ "raw": ""foo"",
263
+ "type": "Literal",
264
+ "value": "foo",
265
+ },
266
+ "value": {
267
+ "__id": Symbol(Expression Node ID),
268
+ "location": {
269
+ "end": {
270
+ "character": 15,
271
+ },
272
+ "start": {
273
+ "character": 9,
274
+ },
275
+ },
276
+ "raw": ""value"",
277
+ "type": "Literal",
278
+ "value": "value",
279
+ },
280
+ },
281
+ {
282
+ "key": {
283
+ "__id": Symbol(Expression Node ID),
284
+ "location": {
285
+ "end": {
286
+ "character": 22,
287
+ },
288
+ "start": {
289
+ "character": 18,
290
+ },
291
+ },
292
+ "raw": ""bar"",
293
+ "type": "Literal",
294
+ "value": "bar",
295
+ },
296
+ "value": {
297
+ "__id": Symbol(Expression Node ID),
298
+ "attributes": [
299
+ {
300
+ "key": {
301
+ "__id": Symbol(Expression Node ID),
302
+ "location": {
303
+ "end": {
304
+ "character": 31,
305
+ },
306
+ "start": {
307
+ "character": 27,
308
+ },
309
+ },
310
+ "raw": ""baz"",
311
+ "type": "Literal",
312
+ "value": "baz",
313
+ },
314
+ "value": {
315
+ "__id": Symbol(Expression Node ID),
316
+ "location": {
317
+ "end": {
318
+ "character": 39,
319
+ },
320
+ "start": {
321
+ "character": 35,
322
+ },
323
+ },
324
+ "raw": ""foo"",
325
+ "type": "Literal",
326
+ "value": "foo",
327
+ },
328
+ },
329
+ ],
330
+ "location": {
331
+ "end": {
332
+ "character": 41,
333
+ },
334
+ "start": {
335
+ "character": 24,
336
+ },
337
+ },
338
+ "type": "Object",
339
+ },
340
+ },
341
+ ],
342
+ "location": {
343
+ "end": {
344
+ "character": 42,
345
+ },
346
+ "start": {
347
+ "character": 0,
348
+ },
349
+ },
350
+ "type": "Object",
351
+ }
352
+ `;
353
+
354
+ exports[`expression parser > objects- in parser 6`] = `
355
+ {
356
+ "__id": Symbol(Expression Node ID),
357
+ "args": [
358
+ {
359
+ "__id": Symbol(Expression Node ID),
360
+ "location": {
361
+ "end": {
362
+ "character": 14,
363
+ },
364
+ "start": {
365
+ "character": 9,
366
+ },
367
+ },
368
+ "raw": ""test"",
369
+ "type": "Literal",
370
+ "value": "test",
371
+ },
372
+ {
373
+ "__id": Symbol(Expression Node ID),
374
+ "attributes": [
375
+ {
376
+ "key": {
377
+ "__id": Symbol(Expression Node ID),
378
+ "location": {
379
+ "end": {
380
+ "character": 22,
381
+ },
382
+ "start": {
383
+ "character": 18,
384
+ },
385
+ },
386
+ "raw": ""key"",
387
+ "type": "Literal",
388
+ "value": "key",
389
+ },
390
+ "value": {
391
+ "__id": Symbol(Expression Node ID),
392
+ "location": {
393
+ "end": {
394
+ "character": 31,
395
+ },
396
+ "start": {
397
+ "character": 25,
398
+ },
399
+ },
400
+ "raw": ""value"",
401
+ "type": "Literal",
402
+ "value": "value",
403
+ },
404
+ },
405
+ ],
406
+ "location": {
407
+ "end": {
408
+ "character": 32,
409
+ },
410
+ "start": {
411
+ "character": 16,
412
+ },
413
+ },
414
+ "type": "Object",
415
+ },
416
+ ],
417
+ "callTarget": {
418
+ "__id": Symbol(Expression Node ID),
419
+ "location": {
420
+ "end": {
421
+ "character": 7,
422
+ },
423
+ "start": {
424
+ "character": 0,
425
+ },
426
+ },
427
+ "name": "publish",
428
+ "type": "Identifier",
429
+ },
430
+ "location": {
431
+ "end": {
432
+ "character": 33,
433
+ },
434
+ "start": {
435
+ "character": 7,
436
+ },
437
+ },
438
+ "type": "CallExpression",
439
+ }
440
+ `;
441
+
442
+ exports[`the happy stuff 1`] = `
443
+ {
444
+ "__id": Symbol(Expression Node ID),
445
+ "location": {
446
+ "end": {
447
+ "character": 3,
448
+ },
449
+ "start": {
450
+ "character": 0,
451
+ },
452
+ },
453
+ "name": "foo",
454
+ "type": "Identifier",
455
+ }
456
+ `;
457
+
458
+ exports[`the happy stuff 2`] = `
459
+ {
460
+ "__id": Symbol(Expression Node ID),
461
+ "left": {
462
+ "__id": Symbol(Expression Node ID),
463
+ "location": {
464
+ "end": {
465
+ "character": 3,
466
+ },
467
+ "start": {
468
+ "character": 0,
469
+ },
470
+ },
471
+ "name": "foo",
472
+ "type": "Identifier",
473
+ },
474
+ "location": {
475
+ "end": {
476
+ "character": 11,
477
+ },
478
+ "start": {
479
+ "character": 0,
480
+ },
481
+ },
482
+ "operator": "===",
483
+ "right": {
484
+ "__id": Symbol(Expression Node ID),
485
+ "location": {
486
+ "end": {
487
+ "character": 11,
488
+ },
489
+ "start": {
490
+ "character": 8,
491
+ },
492
+ },
493
+ "name": "bar",
494
+ "type": "Identifier",
495
+ },
496
+ "type": "BinaryExpression",
497
+ }
498
+ `;
499
+
500
+ exports[`the happy stuff 3`] = `
501
+ {
502
+ "__id": Symbol(Expression Node ID),
503
+ "left": {
504
+ "__id": Symbol(Expression Node ID),
505
+ "location": {
506
+ "end": {
507
+ "character": 3,
508
+ },
509
+ "start": {
510
+ "character": 0,
511
+ },
512
+ },
513
+ "name": "foo",
514
+ "type": "Identifier",
515
+ },
516
+ "location": {
517
+ "end": {
518
+ "character": 10,
519
+ },
520
+ "start": {
521
+ "character": 0,
522
+ },
523
+ },
524
+ "operator": "||",
525
+ "right": {
526
+ "__id": Symbol(Expression Node ID),
527
+ "location": {
528
+ "end": {
529
+ "character": 10,
530
+ },
531
+ "start": {
532
+ "character": 7,
533
+ },
534
+ },
535
+ "name": "bar",
536
+ "type": "Identifier",
537
+ },
538
+ "type": "LogicalExpression",
539
+ }
540
+ `;
541
+
542
+ exports[`the happy stuff 4`] = `
543
+ {
544
+ "__id": Symbol(Expression Node ID),
545
+ "args": [
546
+ {
547
+ "__id": Symbol(Expression Node ID),
548
+ "location": {
549
+ "end": {
550
+ "character": 7,
551
+ },
552
+ "start": {
553
+ "character": 4,
554
+ },
555
+ },
556
+ "name": "bar",
557
+ "type": "Identifier",
558
+ },
559
+ ],
560
+ "callTarget": {
561
+ "__id": Symbol(Expression Node ID),
562
+ "location": {
563
+ "end": {
564
+ "character": 3,
565
+ },
566
+ "start": {
567
+ "character": 0,
568
+ },
569
+ },
570
+ "name": "foo",
571
+ "type": "Identifier",
572
+ },
573
+ "location": {
574
+ "end": {
575
+ "character": 8,
576
+ },
577
+ "start": {
578
+ "character": 3,
579
+ },
580
+ },
581
+ "type": "CallExpression",
582
+ }
583
+ `;
584
+
585
+ exports[`the happy stuff 5`] = `
586
+ {
587
+ "__id": Symbol(Expression Node ID),
588
+ "left": {
589
+ "__id": Symbol(Expression Node ID),
590
+ "location": {
591
+ "end": {
592
+ "character": 7,
593
+ },
594
+ "start": {
595
+ "character": 0,
596
+ },
597
+ },
598
+ "ref": "foo",
599
+ "type": "ModelRef",
600
+ },
601
+ "location": {
602
+ "end": {
603
+ "character": 15,
604
+ },
605
+ "start": {
606
+ "character": 0,
607
+ },
608
+ },
609
+ "operator": "=",
610
+ "right": {
611
+ "__id": Symbol(Expression Node ID),
612
+ "location": {
613
+ "end": {
614
+ "character": 15,
615
+ },
616
+ "start": {
617
+ "character": 11,
618
+ },
619
+ },
620
+ "raw": ""bar"",
621
+ "type": "Literal",
622
+ "value": "bar",
623
+ },
624
+ "type": "Assignment",
625
+ }
626
+ `;
627
+
628
+ exports[`the happy stuff 6`] = `
629
+ {
630
+ "__id": Symbol(Expression Node ID),
631
+ "alternate": {
632
+ "__id": Symbol(Expression Node ID),
633
+ "location": {
634
+ "end": {
635
+ "character": 23,
636
+ },
637
+ "start": {
638
+ "character": 19,
639
+ },
640
+ },
641
+ "raw": ""baz"",
642
+ "type": "Literal",
643
+ "value": "baz",
644
+ },
645
+ "consequent": {
646
+ "__id": Symbol(Expression Node ID),
647
+ "location": {
648
+ "end": {
649
+ "character": 15,
650
+ },
651
+ "start": {
652
+ "character": 11,
653
+ },
654
+ },
655
+ "raw": ""bar"",
656
+ "type": "Literal",
657
+ "value": "bar",
658
+ },
659
+ "location": {
660
+ "end": {
661
+ "character": 23,
662
+ },
663
+ "start": {
664
+ "character": 8,
665
+ },
666
+ },
667
+ "test": {
668
+ "__id": Symbol(Expression Node ID),
669
+ "location": {
670
+ "end": {
671
+ "character": 7,
672
+ },
673
+ "start": {
674
+ "character": 0,
675
+ },
676
+ },
677
+ "ref": "foo",
678
+ "type": "ModelRef",
679
+ },
680
+ "type": "ConditionalExpression",
681
+ }
682
+ `;
683
+
684
+ exports[`the happy stuff 7`] = `
685
+ {
686
+ "__id": Symbol(Expression Node ID),
687
+ "computed": true,
688
+ "location": {
689
+ "end": {
690
+ "character": 7,
691
+ },
692
+ "start": {
693
+ "character": 3,
694
+ },
695
+ },
696
+ "object": {
697
+ "__id": Symbol(Expression Node ID),
698
+ "location": {
699
+ "end": {
700
+ "character": 3,
701
+ },
702
+ "start": {
703
+ "character": 0,
704
+ },
705
+ },
706
+ "name": "foo",
707
+ "type": "Identifier",
708
+ },
709
+ "property": {
710
+ "__id": Symbol(Expression Node ID),
711
+ "location": {
712
+ "end": {
713
+ "character": 7,
714
+ },
715
+ "start": {
716
+ "character": 4,
717
+ },
718
+ },
719
+ "name": "bar",
720
+ "type": "Identifier",
721
+ },
722
+ "type": "MemberExpression",
723
+ }
724
+ `;
725
+
726
+ exports[`the happy stuff 8`] = `
727
+ {
728
+ "__id": Symbol(Expression Node ID),
729
+ "left": {
730
+ "__id": Symbol(Expression Node ID),
731
+ "location": {
732
+ "end": {
733
+ "character": 7,
734
+ },
735
+ "start": {
736
+ "character": 0,
737
+ },
738
+ },
739
+ "ref": "foo",
740
+ "type": "ModelRef",
741
+ },
742
+ "location": {
743
+ "end": {
744
+ "character": 31,
745
+ },
746
+ "start": {
747
+ "character": 0,
748
+ },
749
+ },
750
+ "operator": "==",
751
+ "right": {
752
+ "__id": Symbol(Expression Node ID),
753
+ "location": {
754
+ "end": {
755
+ "character": 31,
756
+ },
757
+ "start": {
758
+ "character": 12,
759
+ },
760
+ },
761
+ "raw": ""string
762
+ with breaks"",
763
+ "type": "Literal",
764
+ "value": "string
765
+ with breaks",
766
+ },
767
+ "type": "BinaryExpression",
768
+ }
769
+ `;
770
+
771
+ exports[`the happy stuff 9`] = `
772
+ {
773
+ "__id": Symbol(Expression Node ID),
774
+ "left": {
775
+ "__id": Symbol(Expression Node ID),
776
+ "location": {
777
+ "end": {
778
+ "character": 3,
779
+ },
780
+ "start": {
781
+ "character": 0,
782
+ },
783
+ },
784
+ "name": "foo",
785
+ "type": "Identifier",
786
+ },
787
+ "location": {
788
+ "end": {
789
+ "character": 15,
790
+ },
791
+ "start": {
792
+ "character": 0,
793
+ },
794
+ },
795
+ "operator": "=",
796
+ "right": {
797
+ "__id": Symbol(Expression Node ID),
798
+ "elements": [
799
+ {
800
+ "__id": Symbol(Expression Node ID),
801
+ "location": {
802
+ "end": {
803
+ "character": 8,
804
+ },
805
+ "start": {
806
+ "character": 7,
807
+ },
808
+ },
809
+ "raw": "1",
810
+ "type": "Literal",
811
+ "value": 1,
812
+ },
813
+ {
814
+ "__id": Symbol(Expression Node ID),
815
+ "location": {
816
+ "end": {
817
+ "character": 11,
818
+ },
819
+ "start": {
820
+ "character": 10,
821
+ },
822
+ },
823
+ "raw": "2",
824
+ "type": "Literal",
825
+ "value": 2,
826
+ },
827
+ {
828
+ "__id": Symbol(Expression Node ID),
829
+ "location": {
830
+ "end": {
831
+ "character": 14,
832
+ },
833
+ "start": {
834
+ "character": 13,
835
+ },
836
+ },
837
+ "raw": "3",
838
+ "type": "Literal",
839
+ "value": 3,
840
+ },
841
+ ],
842
+ "location": {
843
+ "end": {
844
+ "character": 15,
845
+ },
846
+ "start": {
847
+ "character": 6,
848
+ },
849
+ },
850
+ "type": "ArrayExpression",
851
+ },
852
+ "type": "Assignment",
853
+ }
854
+ `;