lib/millstone.js
function cachepath(location) {
    var uri = url.parse(location);
    if (!uri.protocol) {
        throw new Error('Invalid URL: ' + location);
    } else {
        var hash = crypto.createHash('md5')
            .update(location)
            .digest('hex')
            .substr(0,8) +
            '-' + path.basename(uri.pathname, path.extname(uri.pathname));
        var extname = path.extname(uri.pathname);
        return _(['.shp', '.zip', '']).include(extname.toLowerCase()) ?
            path.join(hash, hash + extname)
            : path.join(hash + extname);
    }
}
function cachepath(location) {
    var uri = url.parse(location);
    if (!uri.protocol) {
        throw new Error('Invalid URL: ' + location);
    } else {
        var hash = crypto.createHash('md5')
            .update(location)
            .digest('hex')
            .substr(0,8) +
            '-' + path.basename(uri.pathname, path.extname(uri.pathname));
        var extname = path.extname(uri.pathname);
        return _(['.shp', '.zip', '']).include(extname.toLowerCase()) ?
            path.join(hash, hash + extname)
            : path.join(hash + extname);
    }
}
function cachepath ( location ) { var uri = url . parse ( location ) ; if ( ! uri . protocol ) { throw new Error ( 'Invalid URL: ' + location ) ; } else { var hash = crypto . createHash ( 'md5' ) . update ( location ) . digest ( 'hex' ) . substr ( 0 , 8 ) + '-' + path . basename ( uri . pathname , path . extname ( uri . pathname ) ) ; var extname = path . extname ( uri . pathname ) ; return _ ( [ '.shp' , '.zip' , '' ] ) . include ( extname . toLowerCase ( ) ) ? path . join ( hash , hash + extname ) : path . join ( hash + extname ) ; } }
Generate the cache path for a given URL.
Generate the cache path for a given URL .