-
Notifications
You must be signed in to change notification settings - Fork 0
/
path.min.js
8 lines (8 loc) · 1.02 KB
/
path.min.js
1
2
3
4
5
6
7
8
/*!
* Path.js - Simple Javascript path management library
* (c) 2014 Jason Lavorante
* MIT Licensed.
*
* https://github.com/jasonlav/path-js
*/
function Path(e){this.config=e;this.config.tags=Tags.get(this.config.tags,e);this.config.prefixes=Tags.get(this.config.prefixes,e)}Path.prototype.url=function(e){if(typeof e==="object"){for(var t in e){e[t]=this.url(e[t])}return e}if(e==="/"){e=""}var n=e;if(this.ignore(e)){return e}e=Tags.get(e,this.config.tags);e=this.prefix(e);if(e===n){return this.clean(this.config.base+e)}else{return this.clean(e)}};Path.prototype.html=function(e,t){if(typeof t!=="boolean"){t=false}return Tags.get(e,this.config.tags,t)};Path.prototype.ignore=function(e){for(var t in this.config.ignorePrefixes){var n=this.config.ignorePrefixes[t];if(e.substr(0,n.length)===n){return true}}return false};Path.prototype.prefix=function(e){for(var t in this.config.prefixes){var n=this.config.prefixes[t];if(e.substr(0,t.length)===t){return n+e.substr(t.length,9999)}}return e};Path.prototype.clean=function(e){return e}