literaljs-router
Advanced tools
Comparing version 0.0.6 to 0.0.61
@@ -1,2 +0,2 @@ | ||
var t,a=!1,e=!1,n=!0;module.exports={Router:function(o){var r=o.path,h=o.routes,i=o.key;void 0===i&&(i="location");var c=o.set;a||(a=!0,window.onpopstate=function(t){var a;e=!0;var n=t.target.location;c(((a={})[i]=n.pathname+n.search+n.hash,a))}),r&&r!==location.pathname||(r=location.pathname+location.search+location.hash);var s=document.createElement("a");s.href=location.origin+r;var p,l=s.pathname+s.search+s.hash;return h=h.find(function(t){return"string"==typeof t.path&&(t.path.match(/^404$/)&&(p=t),t.path=new RegExp("^"+t.path+"$","i")),s.pathname.match(t.path)}),e?e=!1:n?n=!1:t!==l&&history.pushState({},null,l),t=l,"object"==typeof h&&h.render?h.render():p?p.render():{element:"div",attributes:{class:"not-found"},children:["Not Found"]}},getParams:function(){if(!location.search)return{};for(var t,a={},e=location.search.substring(1).split("&"),n=0;n<e.length;n++)a[(t=e[n].split("="))[0]]=t[1];return a}}; | ||
var t,a=!1,e=!1,r=!0;function n(n){var o=n.path,h=n.routes,i=n.key;void 0===i&&(i="location");var s=n.set;a||(a=!0,window.onpopstate=function(t){var a;e=!0;var r=t.target.location;s(((a={})[i]=r.pathname+r.search+r.hash,a))}),o&&o!==location.pathname||(o=location.pathname+location.search+location.hash);var c=document.createElement("a");c.href=location.origin+o;var p,l=c.pathname+c.search+c.hash;return h=h.find(function(t){return"string"==typeof t.path&&(t.path.match(/^404$/)&&(p=t),t.path=new RegExp("^"+t.path+"$","i")),c.pathname.match(t.path)}),e?e=!1:r?r=!1:t!==l&&history.pushState({},null,l),t=l,"object"==typeof h&&h.render?h.render():p?p.render():{element:"div",attributes:{class:"not-found"},children:["Not Found"]}}function o(){if(!location.search)return{};for(var t,a={},e=location.search.substring(1).split("&"),r=0;r<e.length;r++)a[(t=e[r].split("="))[0]]=t[1];return a}var h={Router:n,getParams:o};exports.Router=n,exports.getParams=o,exports.default=h; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.literaljsRouter=e()}(this,function(){var t,e=!1,n=!1,a=!0;return{Router:function(o){var r=o.path,i=o.routes,h=o.key;void 0===h&&(h="location");var c=o.set;e||(e=!0,window.onpopstate=function(t){var e;n=!0;var a=t.target.location;c(((e={})[h]=a.pathname+a.search+a.hash,e))}),r&&r!==location.pathname||(r=location.pathname+location.search+location.hash);var s=document.createElement("a");s.href=location.origin+r;var u,p=s.pathname+s.search+s.hash;return i=i.find(function(t){return"string"==typeof t.path&&(t.path.match(/^404$/)&&(u=t),t.path=new RegExp("^"+t.path+"$","i")),s.pathname.match(t.path)}),n?n=!1:a?a=!1:t!==p&&history.pushState({},null,p),t=p,"object"==typeof i&&i.render?i.render():u?u.render():{element:"div",attributes:{class:"not-found"},children:["Not Found"]}},getParams:function(){if(!location.search)return{};for(var t,e={},n=location.search.substring(1).split("&"),a=0;a<n.length;a++)e[(t=n[a].split("="))[0]]=t[1];return e}}}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.literaljsRouter={})}(this,function(t){var e,a=!1,n=!1,o=!0;function r(t){var r=t.path,i=t.routes,h=t.key;void 0===h&&(h="location");var c=t.set;a||(a=!0,window.onpopstate=function(t){var e;n=!0;var a=t.target.location;c(((e={})[h]=a.pathname+a.search+a.hash,e))}),r&&r!==location.pathname||(r=location.pathname+location.search+location.hash);var s=document.createElement("a");s.href=location.origin+r;var p,u=s.pathname+s.search+s.hash;return i=i.find(function(t){return"string"==typeof t.path&&(t.path.match(/^404$/)&&(p=t),t.path=new RegExp("^"+t.path+"$","i")),s.pathname.match(t.path)}),n?n=!1:o?o=!1:e!==u&&history.pushState({},null,u),e=u,"object"==typeof i&&i.render?i.render():p?p.render():{element:"div",attributes:{class:"not-found"},children:["Not Found"]}}function i(){if(!location.search)return{};for(var t,e={},a=location.search.substring(1).split("&"),n=0;n<a.length;n++)e[(t=a[n].split("="))[0]]=t[1];return e}var h={Router:r,getParams:i};t.Router=r,t.getParams=i,t.default=h}); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "literaljs-router", | ||
"version": "0.0.6", | ||
"version": "0.0.61", | ||
"description": "A router built to work with LiteralJS.", | ||
@@ -24,4 +24,4 @@ "main": "build/index.js", | ||
"devDependencies": { | ||
"microbundle": "^0.4.3" | ||
"microbundle": "^0.11.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
186102
12