lib/util.js
function fulfillName (name, ext, mask, lang) {
    var shortname;
    var params;

    // support hash with params as first function param
    if (isPlainObject(name)) {
        params = name;

        name = params.name;
        ext = params.ext;
        mask = params.mask;
        lang = params.lang;
    }

    shortname = basename(name);
    if (mask) {
        name = join(name, unmaskName(shortname, mask, lang));
    }

    var curext = extname(name);
    if (curext) {
        return name;
    }

    // prepend dot to extension
    if (ext[0] !== '.') {
        ext = '.' + ext;
    }

    return join(name, shortname + ext);
}
function fulfillName (name, ext, mask, lang) {
    var shortname;
    var params;

    // support hash with params as first function param
    if (isPlainObject(name)) {
        params = name;

        name = params.name;
        ext = params.ext;
        mask = params.mask;
        lang = params.lang;
    }

    shortname = basename(name);
    if (mask) {
        name = join(name, unmaskName(shortname, mask, lang));
    }

    var curext = extname(name);
    if (curext) {
        return name;
    }

    // prepend dot to extension
    if (ext[0] !== '.') {
        ext = '.' + ext;
    }

    return join(name, shortname + ext);
}
function fulfillName ( name , ext , mask , lang ) { var shortname ; var params ; // support hash with params as first function param if ( isPlainObject ( name ) ) { params = name ; name = params . name ; ext = params . ext ; mask = params . mask ; lang = params . lang ; } shortname = basename ( name ) ; if ( mask ) { name = join ( name , unmaskName ( shortname , mask , lang ) ) ; } var curext = extname ( name ) ; if ( curext ) { return name ; } // prepend dot to extension if ( ext [ 0 ] !== '.' ) { ext = '.' + ext ; } return join ( name , shortname + ext ) ; }
Appends filename with extension to path
@param {String|Object} name file name or hash with all function params
@param {String} ext extension if not exists
@param {String} [mask]
@returns {String}
Appends filename with extension to path