memberLiteralsOf: the object literals whose members a value gives its owner. The value itself, through `as const`, `satisfies` and parentheses, or the literals handed directly to the call or the `new` it is (`defineConfig({…})`, `new Vuex.Store({…})`).
(&self, value: Node<'t>)
| 1112 | /// parentheses, or the literals handed directly to the call or the `new` |
| 1113 | /// it is (`defineConfig({…})`, `new Vuex.Store({…})`). |
| 1114 | fn member_literals_of(&self, value: Node<'t>) -> Vec<Node<'t>> { |
| 1115 | let mut node = value; |
| 1116 | while matches!(node.kind(), "as_expression" | "satisfies_expression" | "parenthesized_expression") { |
| 1117 | let mut cursor = node.walk(); |
| 1118 | let inner = node.named_children(&mut cursor).find(|child| child.kind() != "comment"); |
| 1119 | let Some(inner) = inner else { return Vec::new() }; |
| 1120 | node = inner; |
| 1121 | } |
| 1122 | if matches!(node.kind(), "object" | "object_expression") { |
| 1123 | return vec![node]; |
| 1124 | } |
| 1125 | if !matches!(node.kind(), "call_expression" | "new_expression") { |
| 1126 | return Vec::new(); |
| 1127 | } |
| 1128 | let Some(arguments) = node.child_by_field_name("arguments") else { return Vec::new() }; |
| 1129 | let mut cursor = arguments.walk(); |
| 1130 | arguments.named_children(&mut cursor).filter_map(|argument| self.object_literal_of(Some(argument))).collect() |
| 1131 | } |
| 1132 | |
| 1133 | /// extractModuleValueMembers: the members of what a module exports or |
| 1134 | /// assigns with no declaration to hold them (`export default {…}`, |
no test coverage detected