diff --git a/.travis.yml b/.travis.yml index aa3c554..aa5bbfb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,8 @@ language: node_js node_js: - "0.10" - "0.12" -- "4" -- "5" +- 4 +- 6 +- 8 +- node script: npm test diff --git a/README.md b/README.md index aee0dcf..4807e81 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ When `true`, will remove `#hashes` from URLs. They are most likely not useful to ## Changelog +* 0.7.0 support for Node.js v9 * 0.6.0 added `.length()` and removed `Object.assign()` polyfill * 0.5.0 removed use of Promises as they were unnecessary * 0.4.0 simpler `Promise`-based API diff --git a/index-browser.js b/index-browser.js index a92da81..e5c8603 100644 --- a/index-browser.js +++ b/index-browser.js @@ -1 +1 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.UrlCache=t()}}(function(){var t;return function e(t,r,n){function o(a,i){if(!r[a]){if(!t[a]){var h="function"==typeof require&&require;if(!i&&h)return h(a,!0);if(s)return s(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=r[a]={exports:{}};t[a][0].call(u.exports,function(e){var r=t[a][1][e];return o(r?r:e)},u,u.exports,e,t,r,n)}return r[a].exports}for(var s="function"==typeof require&&require,a=0;a1&&(n=r[0]+"@",t=r[1]),t=t.replace(w,".");var o=t.split("."),s=a(o,e).join(".");return n+s}function h(t){for(var e,r,n=[],o=0,s=t.length;s>o;)e=t.charCodeAt(o++),e>=55296&&56319>=e&&s>o?(r=t.charCodeAt(o++),56320==(64512&r)?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),o--)):n.push(e);return n}function l(t){return a(t,function(t){var e="";return t>65535&&(t-=65536,e+=N(t>>>10&1023|55296),t=56320|1023&t),e+=N(t)}).join("")}function u(t){return 10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:E}function c(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function f(t,e,r){var n=0;for(t=r?H(t/j):t>>1,t+=H(t/e);t>P*S>>1;n+=E)t=H(t/P);return H(n+(P+1)*t/(t+U))}function p(t){var e,r,n,o,a,i,h,c,p,y,d=[],m=t.length,x=0,v=R,g=A;for(r=t.lastIndexOf(L),0>r&&(r=0),n=0;r>n;++n)t.charCodeAt(n)>=128&&s("not-basic"),d.push(t.charCodeAt(n));for(o=r>0?r+1:0;m>o;){for(a=x,i=1,h=E;o>=m&&s("invalid-input"),c=u(t.charCodeAt(o++)),(c>=E||c>H((T-x)/i))&&s("overflow"),x+=c*i,p=g>=h?I:h>=g+S?S:h-g,!(p>c);h+=E)y=E-p,i>H(T/y)&&s("overflow"),i*=y;e=d.length+1,g=f(x-a,e,0==a),H(x/e)>T-v&&s("overflow"),v+=H(x/e),x%=e,d.splice(x++,0,v)}return l(d)}function y(t){var e,r,n,o,a,i,l,u,p,y,d,m,x,v,g,O=[];for(t=h(t),m=t.length,e=R,r=0,a=A,i=0;m>i;++i)d=t[i],128>d&&O.push(N(d));for(n=o=O.length,o&&O.push(L);m>n;){for(l=T,i=0;m>i;++i)d=t[i],d>=e&&l>d&&(l=d);for(x=n+1,l-e>H((T-r)/x)&&s("overflow"),r+=(l-e)*x,e=l,i=0;m>i;++i)if(d=t[i],e>d&&++r>T&&s("overflow"),d==e){for(u=r,p=E;y=a>=p?I:p>=a+S?S:p-a,!(y>u);p+=E)g=u-y,v=E-y,O.push(N(c(y+g%v,0))),u=H(g/v);O.push(N(c(u,0))),a=f(r,x,n==o),r=0,++n}++r,++e}return O.join("")}function d(t){return i(t,function(t){return C.test(t)?p(t.slice(4).toLowerCase()):t})}function m(t){return i(t,function(t){return D.test(t)?"xn--"+y(t):t})}var x="object"==typeof n&&n&&!n.nodeType&&n,v="object"==typeof r&&r&&!r.nodeType&&r,g="object"==typeof e&&e;(g.global===g||g.window===g||g.self===g)&&(o=g);var O,b,T=2147483647,E=36,I=1,S=26,U=38,j=700,A=72,R=128,L="-",C=/^xn--/,D=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,q={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},P=E-I,H=Math.floor,N=String.fromCharCode;if(O={version:"1.3.2",ucs2:{decode:h,encode:l},decode:p,encode:y,toASCII:m,toUnicode:d},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return O});else if(x&&v)if(r.exports==x)v.exports=O;else for(b in O)O.hasOwnProperty(b)&&(x[b]=O[b]);else o.punycode=O}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],6:[function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,s){e=e||"&",r=r||"=";var a={};if("string"!=typeof t||0===t.length)return a;var i=/\+/g;t=t.split(e);var h=1e3;s&&"number"==typeof s.maxKeys&&(h=s.maxKeys);var l=t.length;h>0&&l>h&&(l=h);for(var u=0;l>u;++u){var c,f,p,y,d=t[u].replace(i,"%20"),m=d.indexOf(r);m>=0?(c=d.substr(0,m),f=d.substr(m+1)):(c=d,f=""),p=decodeURIComponent(c),y=decodeURIComponent(f),n(a,p)?o(a[p])?a[p].push(y):a[p]=[a[p],y]:a[p]=y}return a};var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],7:[function(t,e,r){"use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n",'"',"`"," ","\r","\n"," "],y=["{","}","|","\\","^","`"].concat(p),d=["'"].concat(y),m=["%","/","?",";","#"].concat(d),x=["/","?","#"],v=255,g=/^[+a-z0-9A-Z_-]{0,63}$/,O=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},T={javascript:!0,"javascript:":!0},E={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},I=t("querystring");n.prototype.parse=function(t,e,r){if(!l.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),o=-1!==n&&nA)&&(U=A)}var R,L;L=-1===U?i.lastIndexOf("@"):i.lastIndexOf("@",U),-1!==L&&(R=i.slice(0,L),i=i.slice(L+1),this.auth=decodeURIComponent(R)),U=-1;for(var j=0;jA)&&(U=A)}-1===U&&(U=i.length),this.host=i.slice(0,U),i=i.slice(U),this.parseHost(),this.hostname=this.hostname||"";var C="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!C)for(var D=this.hostname.split(/\./),j=0,w=D.length;w>j;j++){var q=D[j];if(q&&!q.match(g)){for(var P="",H=0,N=q.length;N>H;H++)P+=q.charCodeAt(H)>127?"x":q[H];if(!P.match(g)){var _=D.slice(0,j),z=D.slice(j+1),M=q.match(O);M&&(_.push(M[1]),z.unshift(M[2])),z.length&&(i="/"+z.join(".")+i),this.hostname=_.join(".");break}}}this.hostname.length>v?this.hostname="":this.hostname=this.hostname.toLowerCase(),C||(this.hostname=h.toASCII(this.hostname));var V=this.port?":"+this.port:"",Y=this.hostname||"";this.host=Y+V,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==i[0]&&(i="/"+i))}if(!b[y])for(var j=0,w=d.length;w>j;j++){var Q=d[j];if(-1!==i.indexOf(Q)){var F=encodeURIComponent(Q);F===Q&&(F=escape(Q)),i=i.split(Q).join(F)}}var B=i.indexOf("#");-1!==B&&(this.hash=i.substr(B),i=i.slice(0,B));var k=i.indexOf("?");if(-1!==k?(this.search=i.substr(k),this.query=i.substr(k+1),e&&(this.query=I.parse(this.query)),i=i.slice(0,k)):e&&(this.search="",this.query={}),i&&(this.pathname=i),E[y]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var V=this.pathname||"",G=this.search||"";this.path=V+G}return this.href=this.format(),this},n.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,s="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&l.isObject(this.query)&&Object.keys(this.query).length&&(s=I.stringify(this.query));var a=this.search||s&&"?"+s||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||E[e])&&o!==!1?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),a&&"?"!==a.charAt(0)&&(a="?"+a),r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),a=a.replace("#","%23"),e+o+r+a+n},n.prototype.resolve=function(t){return this.resolveObject(o(t,!1,!0)).format()},n.prototype.resolveObject=function(t){if(l.isString(t)){var e=new n;e.parse(t,!1,!0),t=e}for(var r=new n,o=Object.keys(this),s=0;s0?r.host.split("@"):!1;S&&(r.auth=S.shift(),r.host=r.hostname=S.shift())}return r.search=t.search,r.query=t.query,l.isNull(r.pathname)&&l.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!b.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var U=b.slice(-1)[0],j=(r.host||t.host||b.length>1)&&("."===U||".."===U)||""===U,A=0,R=b.length;R>=0;R--)U=b[R],"."===U?b.splice(R,1):".."===U?(b.splice(R,1),A++):A&&(b.splice(R,1),A--);if(!g&&!O)for(;A--;A)b.unshift("..");!g||""===b[0]||b[0]&&"/"===b[0].charAt(0)||b.unshift(""),j&&"/"!==b.join("/").substr(-1)&&b.push("");var L=""===b[0]||b[0]&&"/"===b[0].charAt(0);if(I){r.hostname=r.host=L?"":b.length?b.shift():"";var S=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;S&&(r.auth=S.shift(),r.host=r.hostname=S.shift())}return g=g||r.host&&b.length,g&&!L&&b.unshift(""),b.length?r.pathname=b.join("/"):(r.pathname=null,r.path=null),l.isNull(r.pathname)&&l.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=c.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":10,punycode:5,querystring:8}],10:[function(t,e,r){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],11:[function(t,e,r){"use strict";e.exports={OTHER:-1,STRING:0,CORE_URL_OBJECT:1,URLOBJ:2}},{}],12:[function(t,e,r){"use strict";e.exports={NOTHING:-1,PROTOCOL:0,SCHEME:0,HOSTNAME:4,PORT:5,HOST:6,AUTH:7,DIRECTORY:8,FILENAME:9,PATHNAME:10,QUERY:11,SEARCH:11,PATH:12,HASH:13,FRAGMENT:13}},{}],13:[function(t,e,r){"use strict";e.exports={UNKNOWN:-1,ABSOLUTE:0,PROTOCOL_RELATIVE:1,ROOT_RELATIVE:2,DIRECTORY_RELATIVE:3,FILENAME_RELATIVE:4,QUERY_RELATIVE:5,EMPTY:6,HASH_RELATIVE:7}},{}],14:[function(t,e,r){"use strict";function n(t,e,r,n){var o,s=t.length,a=r.length;if(1>s&&e===!1)return!0;if(1>a&&n===!1)return!0;if(e!==n)return!1;if(s!==a)return!1;for(o=0;s>o;o++)if(t[o]!==r[o])return!1;return!0}e.exports=n},{}],15:[function(t,e,r){"use strict";function n(t,e){var r,n,o,s,a,i,h,l=0;for(r in t){if(s=t.hasOwnProperty(r),i=e.hasOwnProperty(r),s===!1||i===!1||s!==i)return!1;if(s=t[r],i=e[r],s!==i){if(Array.isArray(s)===!1||Array.isArray(i)===!1)return!1;if(o=s.length,o!==i.length)return!1;for(a=s.slice().sort(),h=i.slice().sort(),n=0;o>n;n++)if(a[n]!==h[n])return!1}l++}return l!==Object.keys(e).length?!1:!0}e.exports=n},{}],16:[function(t,e,r){"use strict";function n(t){var e=t.pathname;return null!==t.search&&(e+=t.search),e}e.exports=n},{}],17:[function(t,e,r){"use strict";function n(t){var e=o(t.extra.directory,t.extra.directoryLeadingSlash);return null!==t.extra.filename&&(e+=t.extra.filename),e}var o=t("./joinDirs");e.exports=n},{"./joinDirs":21}],18:[function(t,e,r){"use strict";e.exports={format:t("url").format,normalize:t("./normalizeUrl"),parse:t("./parseUrl"),relation:t("./urlRelation"),resolve:t("./resolveUrl"),component:t("./UrlComponent"),type:t("./UrlType"),areSameDir:t("./areSameDir"),areSameQuery:t("./areSameQuery"),joinDirs:t("./joinDirs"),joinQuery:t("./joinQuery"),normalizeDirs:t("./normalizeDirs"),parsePath:t("./parsePath"),resolveDirs:t("./resolveDirs"),typeofUrl:t("./typeofUrl")}},{"./UrlComponent":12,"./UrlType":13,"./areSameDir":14,"./areSameQuery":15,"./joinDirs":21,"./joinQuery":22,"./normalizeDirs":23,"./normalizeUrl":24,"./parsePath":25,"./parseUrl":26,"./resolveDirs":27,"./resolveUrl":28,"./typeofUrl":29,"./urlRelation":30,url:9}],19:[function(t,e,r){"use strict";function n(t){return s(t)===!0?a.STRING:o(t)===!0&&Array.isArray(t)===!1&&void 0!==t.protocol?o(t.extra)===!0?a.URLOBJ:a.CORE_URL_OBJECT:a.OTHER}var o=t("is-object"),s=t("is-string"),a=t("./InputTypes");e.exports=n},{"./InputTypes":11,"is-object":2,"is-string":3}],20:[function(t,e,r){"use strict";function n(t,e,r){return null!==t?null===e?!0:(o(r)===!1&&(r=s),r[t]===parseInt(e)):null}var o=t("is-object"),s={ftp:21,gopher:70,http:80,https:443};e.exports=n},{"is-object":2}],21:[function(t,e,r){"use strict";function n(t,e){var r,n=t.length,o=e===!0?"/":"";for(r=0;n>r;r++)""!==t[r]&&(o+=t[r]+"/");return o}e.exports=n},{}],22:[function(t,e,r){"use strict";function n(t,e){var r,n,s,a,i={i:0},h="";for(a in t)if(t.hasOwnProperty(a)===!0)if(s=t[a],Array.isArray(s)===!1)h+=o(a,s,i,e);else for(n=s.length,r=0;n>r;r++)h+=o(a,s[r],i,e);return h}function o(t,e,r,n){var o="";return(""!==t&&""!==e||n!==!0)&&(o+=++r.i>1?"&":"?",t=encodeURIComponent(t),o+=""!==e?t+"="+encodeURIComponent(e).replace(/%20/g,"+"):t+"="),o}e.exports=n},{}],23:[function(t,e,r){"use strict";function n(t,e){var r,n,o,s=t.length,a={dir:[],leadingSlash:e===!0};for(n=0;s>n;n++)r=t[n],".."!==r?"."!==r&&a.dir.push(r):(o=a.dir.length>0?a.dir[a.dir.length-1]:null,null!==o&&(a.leadingSlash===!0||".."!==o&&"."!==o)?a.dir.splice(a.dir.length-1,1):a.leadingSlash===!1&&a.dir.push(r));return a}e.exports=n},{}],24:[function(t,e,r){"use strict";function n(t,e){var r;return t=l(t,e),t.extra.portIsDefault===!0&&null!==t.port&&(o(t.host)===!0&&(r=":"+t.port,t.host.substr(-r.length)===r&&(t.host=t.host.slice(0,-r.length))),t.port=null),t.extra.directory=h(t.extra.directory,t.extra.directoryLeadingSlash).dir,t.pathname=i(t),"?"===t.search&&(t.search=null,("?"===t.query||""===t.query)&&(t.query=null)),t.path=a(t),t.href=s.format(t),t}var o=t("is-string"),s=t("url"),a=t("./formatPath"),i=t("./formatPathname"),h=t("./normalizeDirs"),l=t("./parseUrl");e.exports=n},{"./formatPath":16,"./formatPathname":17,"./normalizeDirs":23,"./parseUrl":26,"is-string":3,url:9}],25:[function(t,e,r){"use strict";function n(t){var e,r,n={dir:[],filename:null,leadingSlash:!1};return s(t)===!0&&t.length>0&&(r=t.lastIndexOf("/"),r>-1?(++rr;r++)""!==e[r]&&o.push(e[r]);return o}var s=t("is-string");e.exports=n},{"is-string":3}],26:[function(t,e,r){"use strict";function n(t,e){return null===t?!0:(Array.isArray(e)===!1&&(e=y),e.indexOf(t)>-1)}function o(t,e){var r={};return r=c(t)===!0?t:{parseQueryString:t,slashesDenoteHost:e}}function s(t,e,r){var s,c=o(e,r),y=a(t);switch(y){case i.STRING:t=p.parse(t,!0,c.slashesDenoteHost);break;case i.CORE_URL_OBJECT:(null==t.search&&null==t.query||f(t.search)===!0&&f(t.query)===!0)&&(t=p.parse(t.href,!0,c.slashesDenoteHost));break;case i.URLOBJ:return t;default:throw new Error("invalid input type")}return s=l(t.pathname),t.extra={},f(t.protocol)===!0?":"===t.protocol[t.protocol.length-1]&&(t.extra.protocolTruncated=t.protocol.substr(0,t.protocol.length-1)):t.extra.protocolTruncated=null,t.extra.portIsDefault=h(t.extra.protocolTruncated,t.port,c.defaultPorts),t.extra.directory=s.dir,t.extra.directoryLeadingSlash=s.leadingSlash,t.extra.filename=s.filename,t.extra.filenameIsIndex=n(s.filename,c.directoryIndexes),t.extra.query=t.query,c.parseQueryString!==!0&&(""!==t.search?"?"===t.search[0]?t.query=t.search.substr(1):t.query=t.search:(t.search=null,t.query=null)),t.extra.type=u(t),t}var a=t("./inputType"),i=t("./InputTypes"),h=t("./isDefaultPort"),l=t("./parsePath"),u=t("./typeofUrl"),c=(t("./UrlType"),t("is-object")),f=t("is-string"),p=t("url"),y=["index.html"];e.exports=s},{"./InputTypes":11,"./UrlType":13,"./inputType":19,"./isDefaultPort":20,"./parsePath":25,"./typeofUrl":29,"is-object":2,"is-string":3,url:9}],27:[function(t,e,r){"use strict";function n(t,e,r,n){var s={dir:null,leadingSlash:!1};return n===!0?(s.dir=r.slice(),s.leadingSlash=n):(s.dir=t.concat(r),s.leadingSlash=e===!0),s.dir=o(s.dir,s.leadingSlash).dir,s}var o=t("./normalizeDirs");e.exports=n},{"./normalizeDirs":23}],28:[function(t,e,r){"use strict";function n(t,e){return e.extra.type>=O.FILENAME_RELATIVE?(e.extra.directory=t.extra.directory.slice(),e.extra.directoryLeadingSlash=t.extra.directoryLeadingSlash,!0):!1}function o(t,e){return e.extra.type>=O.QUERY_RELATIVE?(e.extra.filename=t.extra.filename,e.extra.filenameIsIndex=t.extra.filenameIsIndex,!0):!1}function s(t,e){return e.extra.type>=O.ROOT_RELATIVE?(e.auth=t.auth,e.host=t.host,e.port=t.port,e.hostname=t.hostname,e.extra.portIsDefault=t.extra.portIsDefault,!0):!1}function a(t,e){return e.extra.type>=O.PROTOCOL_RELATIVE?(e.protocol=t.protocol,e.slashes=t.slashes,e.extra.protocolTruncated=t.extra.protocolTruncated,!0):!1}function i(t,e){return e.extra.type>=O.EMPTY?(e.search=t.search,b(t.query)===!0?(e.query=T({},t.query),e.extra.query=e.query):(e.query=t.query,e.extra.query=T({},t.extra.query)),!0):!1}function h(t,e){var r;return t.extra.directory=y(t.extra.directory,t.extra.directoryLeadingSlash).dir,e.extra.directory=y(e.extra.directory,e.extra.directoryLeadingSlash).dir,r=m(t.extra.directory,t.extra.directoryLeadingSlash,e.extra.directory,e.extra.directoryLeadingSlash),e.extra.directory=r.dir,e.extra.directoryLeadingSlash=r.leadingSlash,!0}function l(t,e,r){var l,y,m=!1,b=!1,S=!1,U=!1,j=!1;return r=T({},I,r),t=d(t,r),e=d(e,r),y=g(t,e),y=v.DIRECTORY||l===!0)&&(b=o(t,e),j=i(t,e)),(m===!0||b===!0)&&(e.pathname=f(e)),(m===!0||b===!0||j===!0)&&(e.path=c(e)),U===!0&&S===!1&&(e.extra.portIsDefault=p(e.protocol,e.port,r.defaultPorts)),(U===!0||S===!0||m===!0||b===!0||j===!0)&&(e.href=E.format(e),e.extra.type=x(e)),e)}var u=t("./areSameDir"),c=t("./formatPath"),f=t("./formatPathname"),p=t("./isDefaultPort"),y=t("./normalizeDirs"),d=t("./parseUrl"),m=t("./resolveDirs"),x=t("./typeofUrl"),v=t("./UrlComponent"),g=t("./urlRelation"),O=t("./UrlType"),b=t("is-object"),T=t("object-assign"),E=t("url"),I={slashesDenoteHost:!0};e.exports=l},{"./UrlComponent":12,"./UrlType":13,"./areSameDir":14,"./formatPath":16,"./formatPathname":17,"./isDefaultPort":20,"./normalizeDirs":23,"./parseUrl":26,"./resolveDirs":27,"./typeofUrl":29,"./urlRelation":30,"is-object":2,"object-assign":4,url:9}],29:[function(t,e,r){"use strict";function n(t){return null!==t.protocol?o.ABSOLUTE:null!==t.hostname?o.PROTOCOL_RELATIVE:t.extra.directoryLeadingSlash===!0?o.ROOT_RELATIVE:t.extra.directory.length>0?o.DIRECTORY_RELATIVE:null!==t.extra.filename?o.FILENAME_RELATIVE:null!==t.search?o.QUERY_RELATIVE:null===t.hash?o.EMPTY:o.HASH_RELATIVE}var o=t("./UrlType");e.exports=n},{"./UrlType":13}],30:[function(t,e,r){"use strict";function n(t,e){var r;if(t=i(t),e=i(e),t.extra.type= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=g-v,j=Math.floor,I=String.fromCharCode;function S(t){throw new RangeError(c[t])}function f(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function d(t,e){var r=t.split("@"),n="";return 1>>10&1023|55296),t=56320|1023&t),e+=I(t)}).join("")}function R(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function L(t,e,r){var n=0;for(t=r?j(t/i):t>>1,t+=j(t/e);p*O>>1j((x-d)/a))&&S("overflow"),d+=h*a,!(h<(l=i<=m?v:m+O<=i?O:i-m));i+=g)a>j(x/(u=g-l))&&S("overflow"),a*=u;m=L(d-s,e=p.length+1,0==s),j(d/e)>x-y&&S("overflow"),y+=j(d/e),d%=e,p.splice(d++,0,y)}return A(p)}function m(t){var e,r,n,o,s,a,i,h,l,u,c,p,f,d,y,m=[];for(p=(t=U(t)).length,e=E,s=b,a=r=0;aj((x-r)/(f=n+1))&&S("overflow"),r+=(i-e)*f,e=i,a=0;ax&&S("overflow"),c==e){for(h=r,l=g;!(h<(u=l<=s?v:s+O<=l?O:l-s));l+=g)y=h-u,d=g-u,m.push(I(R(u+y%d,0))),h=j(y/d);m.push(I(R(h,0))),s=L(r,f,n==o),r=0,++n}++r,++e}return m.join("")}if(o={version:"1.4.1",ucs2:{decode:U,encode:A},decode:y,encode:m,toASCII:function(t){return d(t,function(t){return l.test(t)?"xn--"+m(t):t})},toUnicode:function(t){return d(t,function(t){return h.test(t)?y(t.slice(4).toLowerCase()):t})}},e&&r)if(D.exports==e)r.exports=o;else for(s in o)o.hasOwnProperty(s)&&(e[s]=o[s]);else t.punycode=o}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],6:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var s=/\+/g;t=t.split(e);var a=1e3;n&&"number"==typeof n.maxKeys&&(a=n.maxKeys);var i,h,l=t.length;0",'"',"`"," ","\r","\n","\t"]),N=["'"].concat(o),_=["%","/","?",";","#"].concat(N),z=["/","?","#"],M=/^[+a-z0-9A-Z_-]{0,63}$/,V=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Y={javascript:!0,"javascript:":!0},Q={javascript:!0,"javascript:":!0},F={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},k=t("querystring");function s(t,e,r){if(t&&q.isObject(t)&&t instanceof U)return t;var n=new U;return n.parse(t,e,r),n}U.prototype.parse=function(t,e,r){if(!q.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),o=-1!==n&&n=w.PROTOCOL_RELATIVE&&(a.protocol=s.protocol,a.slashes=s.slashes,a.extra.protocolTruncated=s.extra.protocolTruncated,!0))&&(i=t,O=(h=e).extra.type>=w.ROOT_RELATIVE&&(h.auth=i.auth,h.host=i.host,h.port=i.port,h.hostname=i.hostname,h.extra.portIsDefault=i.extra.portIsDefault,!0)),o=w.FILENAME_RELATIVE&&(u.extra.directory=l.extra.directory.slice(),u.extra.directoryLeadingSlash=l.extra.directoryLeadingSlash,!0)),(o>=C.DIRECTORY||!0===n)&&(m=t,v=(x=e).extra.type>=w.QUERY_RELATIVE&&(x.extra.filename=m.extra.filename,x.extra.filenameIsIndex=m.extra.filenameIsIndex,!0),d=t,E=(y=e).extra.type>=w.EMPTY&&(y.search=d.search,!0===q(d.query)?(y.query=P({},d.query),y.extra.query=y.query):(y.query=d.query,y.extra.query=P({},d.extra.query)),!0)),!0!==g&&!0!==v||(e.pathname=I(e)),!0!==g&&!0!==v&&!0!==E||(e.path=j(e)),!0===b&&!1===O&&(e.extra.portIsDefault=S(e.protocol,e.port,r.defaultPorts)),!0!==b&&!0!==O&&!0!==g&&!0!==v&&!0!==E||(e.href=H.format(e),e.extra.type=L(e))),e}},{"./UrlComponent":12,"./UrlType":13,"./areSameDir":14,"./formatPath":16,"./formatPathname":17,"./isDefaultPort":20,"./normalizeDirs":23,"./parseUrl":26,"./resolveDirs":27,"./typeofUrl":29,"./urlRelation":30,"is-object":2,"object-assign":4,url:9}],29:[function(t,e,r){"use strict";var n=t("./UrlType");e.exports=function(t){return null!==t.protocol?n.ABSOLUTE:null!==t.hostname?n.PROTOCOL_RELATIVE:!0===t.extra.directoryLeadingSlash?n.ROOT_RELATIVE:0 (https://www.svachon.com/)", + "repository": "stevenvachon/urlcache", "dependencies": { - "urlobj": "0.0.8" + "urlobj": "0.0.11" }, "devDependencies": { - "bhttp": "^1.2.1", - "browserify": "^13.0.0", + "bhttp": "^1.2.4", + "browserify": "^16.1.1", "chai": "^3.5.0", "chai-as-promised": "^5.2.0", - "es6-promise": "^3.0.2", - "mocha": "^2.4.5", - "object.assign": "^4.0.3", - "uglify-js": "^2.6.1" + "es6-promise": "^3.3.1", + "mocha": "^3.5.3", + "object.assign": "^4.1.0", + "uglify-js": "^3.3.14" }, "engines": { - "node": ">= 4" + "node": ">= 0.10" }, "scripts": { "browserify": "browserify index.js --standalone UrlCache | uglifyjs --compress --mangle -o index-browser.js",