jahresbericht2018/assets/js/router.js

1 line
601 B
JavaScript

"use strict";define("router",[],function(){return void 0!==window.console&&(void 0===window.App?console.error("Global App object not defined."):void 0===window.App.routes&&console.error("Global App object hast no routes key.")),window.router=new class{constructor(e){this.routes=e}match(e,o){let r=this.routes[e];return Object.keys(o||{}).forEach(e=>{r=r.replace("__"+this._underscore(e).toUpperCase()+"__",o[e])}),new Promise((e,o)=>{e(r)})}_underscore(e){let o=""+e;return o=(o=(o=o.replace(/([A-Z\d]+)([A-Z][a-z])/g,"$1_$2")).replace(/([a-z\d])([A-Z])/g,"$1_$2")).replace(/-/g,"_")}}(App.routes)});