functions.json 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837
  1. [{
  2. "given":
  3. {
  4. "foo": -1,
  5. "zero": 0,
  6. "numbers": [-1, 3, 4, 5],
  7. "array": [-1, 3, 4, 5, "a", "100"],
  8. "strings": ["a", "b", "c"],
  9. "decimals": [1.01, 1.2, -1.5],
  10. "str": "Str",
  11. "false": false,
  12. "empty_list": [],
  13. "empty_hash": {},
  14. "objects": {"foo": "bar", "bar": "baz"},
  15. "null_key": null
  16. },
  17. "cases": [
  18. {
  19. "expression": "abs(foo)",
  20. "result": 1
  21. },
  22. {
  23. "expression": "abs(foo)",
  24. "result": 1
  25. },
  26. {
  27. "expression": "abs(str)",
  28. "error": "invalid-type"
  29. },
  30. {
  31. "expression": "abs(array[1])",
  32. "result": 3
  33. },
  34. {
  35. "expression": "abs(array[1])",
  36. "result": 3
  37. },
  38. {
  39. "expression": "abs(`false`)",
  40. "error": "invalid-type"
  41. },
  42. {
  43. "expression": "abs(`-24`)",
  44. "result": 24
  45. },
  46. {
  47. "expression": "abs(`-24`)",
  48. "result": 24
  49. },
  50. {
  51. "expression": "abs(`1`, `2`)",
  52. "error": "invalid-arity"
  53. },
  54. {
  55. "expression": "abs()",
  56. "error": "invalid-arity"
  57. },
  58. {
  59. "expression": "unknown_function(`1`, `2`)",
  60. "error": "unknown-function"
  61. },
  62. {
  63. "expression": "avg(numbers)",
  64. "result": 2.75
  65. },
  66. {
  67. "expression": "avg(array)",
  68. "error": "invalid-type"
  69. },
  70. {
  71. "expression": "avg('abc')",
  72. "error": "invalid-type"
  73. },
  74. {
  75. "expression": "avg(foo)",
  76. "error": "invalid-type"
  77. },
  78. {
  79. "expression": "avg(@)",
  80. "error": "invalid-type"
  81. },
  82. {
  83. "expression": "avg(strings)",
  84. "error": "invalid-type"
  85. },
  86. {
  87. "expression": "avg(empty_list)",
  88. "result": null
  89. },
  90. {
  91. "expression": "ceil(`1.2`)",
  92. "result": 2
  93. },
  94. {
  95. "expression": "ceil(decimals[0])",
  96. "result": 2
  97. },
  98. {
  99. "expression": "ceil(decimals[1])",
  100. "result": 2
  101. },
  102. {
  103. "expression": "ceil(decimals[2])",
  104. "result": -1
  105. },
  106. {
  107. "expression": "ceil('string')",
  108. "error": "invalid-type"
  109. },
  110. {
  111. "expression": "contains('abc', 'a')",
  112. "result": true
  113. },
  114. {
  115. "expression": "contains('abc', 'd')",
  116. "result": false
  117. },
  118. {
  119. "expression": "contains(`false`, 'd')",
  120. "error": "invalid-type"
  121. },
  122. {
  123. "expression": "contains(strings, 'a')",
  124. "result": true
  125. },
  126. {
  127. "expression": "contains(decimals, `1.2`)",
  128. "result": true
  129. },
  130. {
  131. "expression": "contains(decimals, `false`)",
  132. "result": false
  133. },
  134. {
  135. "expression": "ends_with(str, 'r')",
  136. "result": true
  137. },
  138. {
  139. "expression": "ends_with(str, 'tr')",
  140. "result": true
  141. },
  142. {
  143. "expression": "ends_with(str, 'Str')",
  144. "result": true
  145. },
  146. {
  147. "expression": "ends_with(str, 'SStr')",
  148. "result": false
  149. },
  150. {
  151. "expression": "ends_with(str, 'foo')",
  152. "result": false
  153. },
  154. {
  155. "expression": "ends_with(str, `0`)",
  156. "error": "invalid-type"
  157. },
  158. {
  159. "expression": "floor(`1.2`)",
  160. "result": 1
  161. },
  162. {
  163. "expression": "floor('string')",
  164. "error": "invalid-type"
  165. },
  166. {
  167. "expression": "floor(decimals[0])",
  168. "result": 1
  169. },
  170. {
  171. "expression": "floor(foo)",
  172. "result": -1
  173. },
  174. {
  175. "expression": "floor(str)",
  176. "error": "invalid-type"
  177. },
  178. {
  179. "expression": "length('abc')",
  180. "result": 3
  181. },
  182. {
  183. "expression": "length('✓foo')",
  184. "result": 4
  185. },
  186. {
  187. "expression": "length('')",
  188. "result": 0
  189. },
  190. {
  191. "expression": "length(@)",
  192. "result": 12
  193. },
  194. {
  195. "expression": "length(strings[0])",
  196. "result": 1
  197. },
  198. {
  199. "expression": "length(str)",
  200. "result": 3
  201. },
  202. {
  203. "expression": "length(array)",
  204. "result": 6
  205. },
  206. {
  207. "expression": "length(objects)",
  208. "result": 2
  209. },
  210. {
  211. "expression": "length(`false`)",
  212. "error": "invalid-type"
  213. },
  214. {
  215. "expression": "length(foo)",
  216. "error": "invalid-type"
  217. },
  218. {
  219. "expression": "length(strings[0])",
  220. "result": 1
  221. },
  222. {
  223. "expression": "max(numbers)",
  224. "result": 5
  225. },
  226. {
  227. "expression": "max(decimals)",
  228. "result": 1.2
  229. },
  230. {
  231. "expression": "max(strings)",
  232. "result": "c"
  233. },
  234. {
  235. "expression": "max(abc)",
  236. "error": "invalid-type"
  237. },
  238. {
  239. "expression": "max(array)",
  240. "error": "invalid-type"
  241. },
  242. {
  243. "expression": "max(decimals)",
  244. "result": 1.2
  245. },
  246. {
  247. "expression": "max(empty_list)",
  248. "result": null
  249. },
  250. {
  251. "expression": "merge(`{}`)",
  252. "result": {}
  253. },
  254. {
  255. "expression": "merge(`{}`, `{}`)",
  256. "result": {}
  257. },
  258. {
  259. "expression": "merge(`{\"a\": 1}`, `{\"b\": 2}`)",
  260. "result": {"a": 1, "b": 2}
  261. },
  262. {
  263. "expression": "merge(`{\"a\": 1}`, `{\"a\": 2}`)",
  264. "result": {"a": 2}
  265. },
  266. {
  267. "expression": "merge(`{\"a\": 1, \"b\": 2}`, `{\"a\": 2, \"c\": 3}`, `{\"d\": 4}`)",
  268. "result": {"a": 2, "b": 2, "c": 3, "d": 4}
  269. },
  270. {
  271. "expression": "min(numbers)",
  272. "result": -1
  273. },
  274. {
  275. "expression": "min(decimals)",
  276. "result": -1.5
  277. },
  278. {
  279. "expression": "min(abc)",
  280. "error": "invalid-type"
  281. },
  282. {
  283. "expression": "min(array)",
  284. "error": "invalid-type"
  285. },
  286. {
  287. "expression": "min(empty_list)",
  288. "result": null
  289. },
  290. {
  291. "expression": "min(decimals)",
  292. "result": -1.5
  293. },
  294. {
  295. "expression": "min(strings)",
  296. "result": "a"
  297. },
  298. {
  299. "expression": "type('abc')",
  300. "result": "string"
  301. },
  302. {
  303. "expression": "type(`1.0`)",
  304. "result": "number"
  305. },
  306. {
  307. "expression": "type(`2`)",
  308. "result": "number"
  309. },
  310. {
  311. "expression": "type(`true`)",
  312. "result": "boolean"
  313. },
  314. {
  315. "expression": "type(`false`)",
  316. "result": "boolean"
  317. },
  318. {
  319. "expression": "type(`null`)",
  320. "result": "null"
  321. },
  322. {
  323. "expression": "type(`[0]`)",
  324. "result": "array"
  325. },
  326. {
  327. "expression": "type(`{\"a\": \"b\"}`)",
  328. "result": "object"
  329. },
  330. {
  331. "expression": "type(@)",
  332. "result": "object"
  333. },
  334. {
  335. "expression": "sort(keys(objects))",
  336. "result": ["bar", "foo"]
  337. },
  338. {
  339. "expression": "keys(foo)",
  340. "error": "invalid-type"
  341. },
  342. {
  343. "expression": "keys(strings)",
  344. "error": "invalid-type"
  345. },
  346. {
  347. "expression": "keys(`false`)",
  348. "error": "invalid-type"
  349. },
  350. {
  351. "expression": "sort(values(objects))",
  352. "result": ["bar", "baz"]
  353. },
  354. {
  355. "expression": "keys(empty_hash)",
  356. "result": []
  357. },
  358. {
  359. "expression": "values(foo)",
  360. "error": "invalid-type"
  361. },
  362. {
  363. "expression": "join(', ', strings)",
  364. "result": "a, b, c"
  365. },
  366. {
  367. "expression": "join(', ', strings)",
  368. "result": "a, b, c"
  369. },
  370. {
  371. "expression": "join(',', `[\"a\", \"b\"]`)",
  372. "result": "a,b"
  373. },
  374. {
  375. "expression": "join(',', `[\"a\", 0]`)",
  376. "error": "invalid-type"
  377. },
  378. {
  379. "expression": "join(', ', str)",
  380. "error": "invalid-type"
  381. },
  382. {
  383. "expression": "join('|', strings)",
  384. "result": "a|b|c"
  385. },
  386. {
  387. "expression": "join(`2`, strings)",
  388. "error": "invalid-type"
  389. },
  390. {
  391. "expression": "join('|', decimals)",
  392. "error": "invalid-type"
  393. },
  394. {
  395. "expression": "join('|', decimals[].to_string(@))",
  396. "result": "1.01|1.2|-1.5"
  397. },
  398. {
  399. "expression": "join('|', empty_list)",
  400. "result": ""
  401. },
  402. {
  403. "expression": "reverse(numbers)",
  404. "result": [5, 4, 3, -1]
  405. },
  406. {
  407. "expression": "reverse(array)",
  408. "result": ["100", "a", 5, 4, 3, -1]
  409. },
  410. {
  411. "expression": "reverse(`[]`)",
  412. "result": []
  413. },
  414. {
  415. "expression": "reverse('')",
  416. "result": ""
  417. },
  418. {
  419. "expression": "reverse('hello world')",
  420. "result": "dlrow olleh"
  421. },
  422. {
  423. "expression": "starts_with(str, 'S')",
  424. "result": true
  425. },
  426. {
  427. "expression": "starts_with(str, 'St')",
  428. "result": true
  429. },
  430. {
  431. "expression": "starts_with(str, 'Str')",
  432. "result": true
  433. },
  434. {
  435. "expression": "starts_with(str, 'String')",
  436. "result": false
  437. },
  438. {
  439. "expression": "starts_with(str, `0`)",
  440. "error": "invalid-type"
  441. },
  442. {
  443. "expression": "sum(numbers)",
  444. "result": 11
  445. },
  446. {
  447. "expression": "sum(decimals)",
  448. "result": 0.71
  449. },
  450. {
  451. "expression": "sum(array)",
  452. "error": "invalid-type"
  453. },
  454. {
  455. "expression": "sum(array[].to_number(@))",
  456. "result": 111
  457. },
  458. {
  459. "expression": "sum(`[]`)",
  460. "result": 0
  461. },
  462. {
  463. "expression": "to_array('foo')",
  464. "result": ["foo"]
  465. },
  466. {
  467. "expression": "to_array(`0`)",
  468. "result": [0]
  469. },
  470. {
  471. "expression": "to_array(objects)",
  472. "result": [{"foo": "bar", "bar": "baz"}]
  473. },
  474. {
  475. "expression": "to_array(`[1, 2, 3]`)",
  476. "result": [1, 2, 3]
  477. },
  478. {
  479. "expression": "to_array(false)",
  480. "result": [false]
  481. },
  482. {
  483. "expression": "to_string('foo')",
  484. "result": "foo"
  485. },
  486. {
  487. "expression": "to_string(`1.2`)",
  488. "result": "1.2"
  489. },
  490. {
  491. "expression": "to_string(`[0, 1]`)",
  492. "result": "[0,1]"
  493. },
  494. {
  495. "expression": "to_number('1.0')",
  496. "result": 1.0
  497. },
  498. {
  499. "expression": "to_number('1.1')",
  500. "result": 1.1
  501. },
  502. {
  503. "expression": "to_number('4')",
  504. "result": 4
  505. },
  506. {
  507. "expression": "to_number('notanumber')",
  508. "result": null
  509. },
  510. {
  511. "expression": "to_number(`false`)",
  512. "result": null
  513. },
  514. {
  515. "expression": "to_number(`null`)",
  516. "result": null
  517. },
  518. {
  519. "expression": "to_number(`[0]`)",
  520. "result": null
  521. },
  522. {
  523. "expression": "to_number(`{\"foo\": 0}`)",
  524. "result": null
  525. },
  526. {
  527. "expression": "\"to_string\"(`1.0`)",
  528. "error": "syntax"
  529. },
  530. {
  531. "expression": "sort(numbers)",
  532. "result": [-1, 3, 4, 5]
  533. },
  534. {
  535. "expression": "sort(strings)",
  536. "result": ["a", "b", "c"]
  537. },
  538. {
  539. "expression": "sort(decimals)",
  540. "result": [-1.5, 1.01, 1.2]
  541. },
  542. {
  543. "expression": "sort(array)",
  544. "error": "invalid-type"
  545. },
  546. {
  547. "expression": "sort(abc)",
  548. "error": "invalid-type"
  549. },
  550. {
  551. "expression": "sort(empty_list)",
  552. "result": []
  553. },
  554. {
  555. "expression": "sort(@)",
  556. "error": "invalid-type"
  557. },
  558. {
  559. "expression": "not_null(unknown_key, str)",
  560. "result": "Str"
  561. },
  562. {
  563. "expression": "not_null(unknown_key, foo.bar, empty_list, str)",
  564. "result": []
  565. },
  566. {
  567. "expression": "not_null(unknown_key, null_key, empty_list, str)",
  568. "result": []
  569. },
  570. {
  571. "expression": "not_null(all, expressions, are_null)",
  572. "result": null
  573. },
  574. {
  575. "expression": "not_null()",
  576. "error": "invalid-arity"
  577. },
  578. {
  579. "comment": "function projection on single arg function",
  580. "expression": "numbers[].to_string(@)",
  581. "result": ["-1", "3", "4", "5"]
  582. },
  583. {
  584. "comment": "function projection on single arg function",
  585. "expression": "array[].to_number(@)",
  586. "result": [-1, 3, 4, 5, 100]
  587. }
  588. ]
  589. }, {
  590. "given":
  591. {
  592. "foo": [
  593. {"b": "b", "a": "a"},
  594. {"c": "c", "b": "b"},
  595. {"d": "d", "c": "c"},
  596. {"e": "e", "d": "d"},
  597. {"f": "f", "e": "e"}
  598. ]
  599. },
  600. "cases": [
  601. {
  602. "comment": "function projection on variadic function",
  603. "expression": "foo[].not_null(f, e, d, c, b, a)",
  604. "result": ["b", "c", "d", "e", "f"]
  605. }
  606. ]
  607. }, {
  608. "given":
  609. {
  610. "people": [
  611. {"age": 20, "age_str": "20", "bool": true, "name": "a", "extra": "foo"},
  612. {"age": 40, "age_str": "40", "bool": false, "name": "b", "extra": "bar"},
  613. {"age": 30, "age_str": "30", "bool": true, "name": "c"},
  614. {"age": 50, "age_str": "50", "bool": false, "name": "d"},
  615. {"age": 10, "age_str": "10", "bool": true, "name": 3}
  616. ]
  617. },
  618. "cases": [
  619. {
  620. "comment": "sort by field expression",
  621. "expression": "sort_by(people, &age)",
  622. "result": [
  623. {"age": 10, "age_str": "10", "bool": true, "name": 3},
  624. {"age": 20, "age_str": "20", "bool": true, "name": "a", "extra": "foo"},
  625. {"age": 30, "age_str": "30", "bool": true, "name": "c"},
  626. {"age": 40, "age_str": "40", "bool": false, "name": "b", "extra": "bar"},
  627. {"age": 50, "age_str": "50", "bool": false, "name": "d"}
  628. ]
  629. },
  630. {
  631. "expression": "sort_by(people, &age_str)",
  632. "result": [
  633. {"age": 10, "age_str": "10", "bool": true, "name": 3},
  634. {"age": 20, "age_str": "20", "bool": true, "name": "a", "extra": "foo"},
  635. {"age": 30, "age_str": "30", "bool": true, "name": "c"},
  636. {"age": 40, "age_str": "40", "bool": false, "name": "b", "extra": "bar"},
  637. {"age": 50, "age_str": "50", "bool": false, "name": "d"}
  638. ]
  639. },
  640. {
  641. "comment": "sort by function expression",
  642. "expression": "sort_by(people, &to_number(age_str))",
  643. "result": [
  644. {"age": 10, "age_str": "10", "bool": true, "name": 3},
  645. {"age": 20, "age_str": "20", "bool": true, "name": "a", "extra": "foo"},
  646. {"age": 30, "age_str": "30", "bool": true, "name": "c"},
  647. {"age": 40, "age_str": "40", "bool": false, "name": "b", "extra": "bar"},
  648. {"age": 50, "age_str": "50", "bool": false, "name": "d"}
  649. ]
  650. },
  651. {
  652. "comment": "function projection on sort_by function",
  653. "expression": "sort_by(people, &age)[].name",
  654. "result": [3, "a", "c", "b", "d"]
  655. },
  656. {
  657. "expression": "sort_by(people, &extra)",
  658. "error": "invalid-type"
  659. },
  660. {
  661. "expression": "sort_by(people, &bool)",
  662. "error": "invalid-type"
  663. },
  664. {
  665. "expression": "sort_by(people, &name)",
  666. "error": "invalid-type"
  667. },
  668. {
  669. "expression": "sort_by(people, name)",
  670. "error": "invalid-type"
  671. },
  672. {
  673. "expression": "sort_by(people, &age)[].extra",
  674. "result": ["foo", "bar"]
  675. },
  676. {
  677. "expression": "sort_by(`[]`, &age)",
  678. "result": []
  679. },
  680. {
  681. "expression": "max_by(people, &age)",
  682. "result": {"age": 50, "age_str": "50", "bool": false, "name": "d"}
  683. },
  684. {
  685. "expression": "max_by(people, &age_str)",
  686. "result": {"age": 50, "age_str": "50", "bool": false, "name": "d"}
  687. },
  688. {
  689. "expression": "max_by(people, &bool)",
  690. "error": "invalid-type"
  691. },
  692. {
  693. "expression": "max_by(people, &extra)",
  694. "error": "invalid-type"
  695. },
  696. {
  697. "expression": "max_by(people, &to_number(age_str))",
  698. "result": {"age": 50, "age_str": "50", "bool": false, "name": "d"}
  699. },
  700. {
  701. "expression": "max_by(`[]`, &age)",
  702. "result": null
  703. },
  704. {
  705. "expression": "min_by(people, &age)",
  706. "result": {"age": 10, "age_str": "10", "bool": true, "name": 3}
  707. },
  708. {
  709. "expression": "min_by(people, &age_str)",
  710. "result": {"age": 10, "age_str": "10", "bool": true, "name": 3}
  711. },
  712. {
  713. "expression": "min_by(people, &bool)",
  714. "error": "invalid-type"
  715. },
  716. {
  717. "expression": "min_by(people, &extra)",
  718. "error": "invalid-type"
  719. },
  720. {
  721. "expression": "min_by(people, &to_number(age_str))",
  722. "result": {"age": 10, "age_str": "10", "bool": true, "name": 3}
  723. },
  724. {
  725. "expression": "min_by(`[]`, &age)",
  726. "result": null
  727. }
  728. ]
  729. }, {
  730. "given":
  731. {
  732. "people": [
  733. {"age": 10, "order": "1"},
  734. {"age": 10, "order": "2"},
  735. {"age": 10, "order": "3"},
  736. {"age": 10, "order": "4"},
  737. {"age": 10, "order": "5"},
  738. {"age": 10, "order": "6"},
  739. {"age": 10, "order": "7"},
  740. {"age": 10, "order": "8"},
  741. {"age": 10, "order": "9"},
  742. {"age": 10, "order": "10"},
  743. {"age": 10, "order": "11"}
  744. ]
  745. },
  746. "cases": [
  747. {
  748. "comment": "stable sort order",
  749. "expression": "sort_by(people, &age)",
  750. "result": [
  751. {"age": 10, "order": "1"},
  752. {"age": 10, "order": "2"},
  753. {"age": 10, "order": "3"},
  754. {"age": 10, "order": "4"},
  755. {"age": 10, "order": "5"},
  756. {"age": 10, "order": "6"},
  757. {"age": 10, "order": "7"},
  758. {"age": 10, "order": "8"},
  759. {"age": 10, "order": "9"},
  760. {"age": 10, "order": "10"},
  761. {"age": 10, "order": "11"}
  762. ]
  763. }
  764. ]
  765. }, {
  766. "given":
  767. {
  768. "people": [
  769. {"a": 10, "b": 1, "c": "z"},
  770. {"a": 10, "b": 2, "c": null},
  771. {"a": 10, "b": 3},
  772. {"a": 10, "b": 4, "c": "z"},
  773. {"a": 10, "b": 5, "c": null},
  774. {"a": 10, "b": 6},
  775. {"a": 10, "b": 7, "c": "z"},
  776. {"a": 10, "b": 8, "c": null},
  777. {"a": 10, "b": 9}
  778. ],
  779. "empty": []
  780. },
  781. "cases": [
  782. {
  783. "expression": "map(&a, people)",
  784. "result": [10, 10, 10, 10, 10, 10, 10, 10, 10]
  785. },
  786. {
  787. "expression": "map(&c, people)",
  788. "result": ["z", null, null, "z", null, null, "z", null, null]
  789. },
  790. {
  791. "expression": "map(&a, badkey)",
  792. "error": "invalid-type"
  793. },
  794. {
  795. "expression": "map(&foo, empty)",
  796. "result": []
  797. }
  798. ]
  799. }, {
  800. "given": {
  801. "array": [
  802. {
  803. "foo": {"bar": "yes1"}
  804. },
  805. {
  806. "foo": {"bar": "yes2"}
  807. },
  808. {
  809. "foo1": {"bar": "no"}
  810. }
  811. ]},
  812. "cases": [
  813. {
  814. "expression": "map(&foo.bar, array)",
  815. "result": ["yes1", "yes2", null]
  816. },
  817. {
  818. "expression": "map(&foo1.bar, array)",
  819. "result": [null, null, "no"]
  820. },
  821. {
  822. "expression": "map(&foo.bar.baz, array)",
  823. "result": [null, null, null]
  824. }
  825. ]
  826. }, {
  827. "given": {
  828. "array": [[1, 2, 3, [4]], [5, 6, 7, [8, 9]]]
  829. },
  830. "cases": [
  831. {
  832. "expression": "map(&[], array)",
  833. "result": [[1, 2, 3, 4], [5, 6, 7, 8, 9]]
  834. }
  835. ]
  836. }
  837. ]