unbuglee
unbuglee

Reputation: 285

Is there any way to know is it a zepto object?

I tried "$('#m') instanceof $",then I got false. how do I know it is a zepto object?

Upvotes: 1

Views: 459

Answers (1)

Ruy Diaz
Ruy Diaz

Reputation: 3122

I just ran into this exact same problem while trying to use Zepto matchers for Jasmine. It seems like Zepto wraps objects using an internal Z function that is only accessible by the closure. I tried exposing it by mapping it to $.Z, which works

$(el) instanceof $.Z // => true

but it still doesn't work with the matchers for some reason. I have created an issue on Zepto's github, so hopefully it's something that can be added in.

Upvotes: 1

Related Questions