albanm / node-libxslt

Node.js bindings for libxslt compatible with libxmljs
50 stars 68 forks source link

params and options parameters validation is missing #66

Open chaitanya-mahamuni opened 6 years ago

chaitanya-mahamuni commented 6 years ago

Please add validations same as "Stylesheet.prototype.apply" method inside method below. https://github.com/albanm/node-libxslt/blob/c51e287903633cbcd1a8ac1531e12e7777ad7191/index.js#L183

This method throws an error "TypeError: callback is not a function" if called only with 2 params as below:

// documentPath : some inaccessible invalid path
stylesheet.applyToFile(documentPath, function(error, result) {
    if( !err ) {
        // handle success
    } else {
        // handle error
    }
});

But above code works well with accessible valid value "documentPath".