| 1 | function useFoo(props: { |
| 2 | x?: string; |
| 3 | y?: string; |
| 4 | z?: string; |
| 5 | doDestructure: boolean; |
| 6 | }) { |
| 7 | let x = null; |
| 8 | let y = null; |
| 9 | let z = null; |
| 10 | const myList = []; |
| 11 | if (props.doDestructure) { |
| 12 | ({x, y, z} = props); |
| 13 | |
| 14 | myList.push(z); |
| 15 | } |
| 16 | return { |
| 17 | x, |
| 18 | y, |
| 19 | myList, |
| 20 | }; |
| 21 | } |
| 22 | |
| 23 | export const FIXTURE_ENTRYPOINT = { |
| 24 | fn: useFoo, |
| 25 | params: [{x: 'hello', y: 'world', doDestructure: true}], |
| 26 | }; |