mikedeboer / jsDAV

jsDAV allows you to easily add WebDAV support to a NodeJS application. jsDAV is meant to cover the entire standard, and attempts to allow integration using an easy to understand API.
http://www.mikedeboer.nl
MIT License
681 stars 159 forks source link

VObject/Property .hasFeature is not defined on String #141

Closed joernroeder closed 8 years ago

joernroeder commented 8 years ago

i've just read througth the VObject code and saw this if else statement in the property.add function: https://github.com/mikedeboer/jsDAV/blob/master/lib/VObject/property.js#L224 You're handling the difference between a Node object and a string here but string doesn't have a .hasFeature method. Therefore i suggest to switch the statement. What do you think? I can submit a pull request if you like :)

if(typeof item == "string") {
}
else if (item.hasFeature(jsVObject_Parameter)) {
}
joernroeder commented 8 years ago

I've also found a similar switch in https://github.com/mikedeboer/jsDAV/blob/master/lib/VObject/component.js#L166 which does the same thing but doesn't break anything due to the additional if (item.hasFeature && …) check.

mikedeboer commented 8 years ago

Yeah, that looks good - please submit a pull request!

joernroeder commented 8 years ago

jup, i'll clean up my repo, squash my commits and open a pull request.