Plato on Github
Report Home
node_modules\atropa-url\src\atropa-url.js
Maintainability
64.41
Lines of code
50
Difficulty
13.32
Estimated Errors
0.14
Function weight
By Complexity
By SLOC
/// <reference path="../../docs/vsdoc/OpenLayersAll.js"/> var atropa = require('atropa-header'); /*jslint indent: 4, maxerr: 50, white: true, browser: true, devel: true, plusplus: true, regexp: true */ /*global atropa */ // end header /** * Utilities for handling urls. * @author <a href="mailto:matthewkastor@gmail.com"> * Matthew Christopher Kastor-Inare III </a><br /> * ☭ Hial Atropa!! ☭ * @version 20130713 * @namespace Utilities for handling urls. */ atropa.url = {}; /** * Gets the filename portion of a url * @function * @param {String} url The url. * @returns {String} Returns everything after the last / in the url. */ atropa.url.getFilename = function(url) { "use strict"; var filename; try { filename = String(url).replace(/.*:\/\/[^\/]+/, '').replace(/[#|?].*$/, '').match(/[^\/]+$/)[0]; } catch (e) { filename = ''; } if(url === filename) { filename = ''; } return filename; }; while(atropa.data.requirements.length > 0) { atropa.data.requirements.pop()(); } module.exports = atropa;