List of packages imported with "using" in a module

module A
  using B
end

is there somefunction(A) that returns a list which contains :B ? If B is imported, names does the job:

module A
  import B
end
names(A, imported=true) # [:A, :B]

I’d ideally like something that can cover both cases (import+using). (The use case is to be able to check that A.B will work, I can explicitly check this but it doesn’t feel like the right approach)

Hmm, after looking at the julia code for getglobal I stumbled upon isdefined which is what I should be using it seems:

isdefined(A, :B) # true