Utilities for Javascript plug

I've seen this test a couple of times in here. What is its semantic? ("Is a dict?") Should it be factored up and semanticized?