/**
 * Precompile jade string to rederalbe function.
 * @function lib.compile.precompileJadeString
 * @see {@link http://jade-lang.com/reference/ | jade}
 * @param {string} src - Jade string to precompile.
 * @param {string} [options] - Jade options.
 * @param {function} callback - Callback when done.
 * @author Taka Okunishi
 *
 */
module.exports = function (src, options, callback) {
    switch (arguments.length) {
        case 2:
            callback = arguments[1];
    }
    var jade = require('jade');
    options = options || {};
    options.pretty = false;
    try{
        var precompiled = jade.compileClient(src, options);
        callback(null, precompiled);
    } catch(e){
        callback(e);
    }
};