plugin options that take an element as a value

plugin options that take an element as a value

We've got a lot of plugins that take an element as a option's value (position's of, draggable's helper, etc.). Each of these work slightly differently because there are so many cases to handle that some of them get overlooked. I wrote a function a long time ago to handle this, but never ended up using it anywhere. Here are the cases I came up with back then as possible options:
Note: In many cases there is a context for determining the element. For example, draggable's helper has a context of the actual draggable element.
jQuery object - just return the object again
DOMElement - wrap it in a jQuery object
array of DOMElements - wrap them in a jQuery object
selector - return the jQuery object that matches the selection
the string "parent" - return the parent of the context element
the string "clone" - return a clone of the context element
function - return the result of executing the function and passing the context element as a parameter
anything else - return an empty jQuery object
I'd like to go through and test this on all of our plugins, but I wanted to see if anything had any other cases that we should be handling.
Here's the code: <a href="http://gist.github.com/233531">http://gist.github.com/233531</a>