; JavaScript pattern detection queries
; Subset of TypeScript patterns (no decorators, no accessibility modifiers)

; === Factory: export function create*() ===

(export_statement
  (function_declaration
    name: (identifier) @name
    (#match? @name "^create[A-Z]"))) @node

; === Dependency Injection markers ===

; container.register(...) / container.bind(...)
(call_expression
  function: (member_expression
    object: (identifier) @_obj
    property: (property_identifier) @_method)
  (#eq? @_obj "container")
  (#match? @_method "^(register|bind)$")) @node

; === Cached instance: new Map() / new WeakMap() ===

(lexical_declaration
  (variable_declarator
    name: (identifier) @name
    value: (new_expression
      constructor: (identifier) @_cls
      (#match? @_cls "^(Map|WeakMap|Set)$")))) @node
