MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / object_literal_of

Method object_literal_of

codegraph-kernel/src/tsjs/extractors.rs:994–1002  ·  view source on GitHub ↗

objectLiteralOf: the object literal `value` is, through `as const`, `satisfies T` and parentheses.

(&self, value: Option<Node<'t>>)

Source from the content-addressed store, hash-verified

992 /// objectLiteralOf: the object literal `value` is, through `as const`,
993 /// `satisfies T` and parentheses.
994 fn object_literal_of(&self, value: Option<Node<'t>>) -> Option<Node<'t>> {
995 let mut node = value?;
996 while matches!(node.kind(), "as_expression" | "satisfies_expression" | "parenthesized_expression") {
997 let mut cursor = node.walk();
998 let inner = node.named_children(&mut cursor).find(|child| child.kind() != "comment");
999 node = inner?;
1000 }
1001 matches!(node.kind(), "object" | "object_expression").then_some(node)
1002 }
1003
1004 /// commentMarks: every byte offset in the source where a comment could
1005 /// begin, each `//` and `/*`, in order; read once for the file. A stretch of

Callers 2

member_literals_ofMethod · 0.80

Calls 1

walkMethod · 0.45

Tested by

no test coverage detected