@danielkalen/simplybind
Version:
Magically simple, framework-less one-way/two-way data binding for frontend/backend in ~5kb.
10 lines • 538 B
text/coffeescript
###*
* Conditional Checks:
*
* 1) Make sure the subject object is iterable (and thus a possible candidate for being an element collection)
* 2) Make sure the subject object isn't an array binding (since element collection objects don't get directly bound)
* 3) Make sure the first element in the collection is a valid object (i.e. isn't undefined and isn't null)
* 4) Make sure the first element is a DOM object
###
if checkIf.isIterable(object) and not object._sb_ID and object[0] and (checkIf.isDom(object[0]))
object = object[0]