UNPKG

2.7 kBPlain TextView Raw
1{"code":"function defineName$__(cls,name){\n\tObject.defineProperty(cls,\"name\",{value:name,configurable:true});\n};\nconst $__initor__$ = Symbol.for('#__initor__'), $__inited__$ = Symbol.for('#__inited__'), $__hooks__$ = Symbol.for('#__hooks__');\n\n/*body*/\nexport class History {\n\t\n\tconstructor(router){\n\t\t\n\t\tthis.router = router;\n\t\tthis.stack = [];\n\t\tthis.pos = -1;\n\t}\n\t\n\tpushState(state,title,url){\n\t\t\n\t\tthis.stack.length = Math.max(this.pos,0);\n\t\tthis.stack[++this.pos] = [state,title,url];\n\t\t// console.log \"pushed state {url}\"\n\t\treturn this;\n\t}\n\t\n\treplaceState(state,title,url){\n\t\t\n\t\t// console.log \"replaced state {url}\"\n\t\tthis.stack.length = this.pos;\n\t\treturn this.stack[this.pos] = [state,title,url];\n\t}\n\t\n\tpopState(){\n\t\t\n\t\tthis.stack.length = this.pos + 1;\n\t\tthis.pos -= 1;\n\t\treturn this.stack.pop();\n\t}\n\t\n\tcurrentState(){\n\t\t\n\t\treturn this.stack[this.pos];\n\t}\n\t\n\tslice(){\n\t\t\n\t\treturn [];\n\t}\n\tstatic {\n\t\tdefineName$__(this,'History');}\n};\n","map":{"version":3,"file":"history.node.js","sourceRoot":"","sources":["/Users/abdellah/workspace/scrimba/imba/packages/imba/src/imba/router/history.node.imba"],"sourcesContent":["export class History\n\tdef constructor router\n\t\trouter = router\n\t\tstack = []\n\t\tpos = -1\n\n\tdef pushState state, title, url\n\t\tstack.length = Math.max(pos,0)\n\t\tstack[++pos] = [state,title,url]\n\t\t# console.log \"pushed state {url}\"\n\t\treturn self\n\n\tdef replaceState state, title, url\n\t\t# console.log \"replaced state {url}\"\n\t\tstack.length = pos\n\t\tstack[pos] = [state,title,url]\n\n\tdef popState\n\t\tstack.length = pos + 1\n\t\tpos -= 1\n\t\treturn stack.pop!\n\n\tdef currentState\n\t\tstack[pos]\n\n\tdef slice\n\t\t[]"],"names":[],"mappings":";;;;;;AAAA,MAAM,CAAC,KAAK,CAAC,OAAO,EAAA;;CACf,WAAW,CAAC,MAAM,CAAA;;EACrB,KAAA,MAAM,GAAG,MAAM;EACf,KAAA,KAAK,GAAG,EAAE;EACV,KAAA,GAAG,GAAG,EAAE;EAAA;;CAEL,SAAS,CAAC,KAAK,CAAE,KAAK,CAAE,GAAG,CAAA;;EAC9B,KAAA,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,KAAA,GAAG,CAAC,CAAC,CAAC;EAC9B,KAAA,KAAK,CAAA,EAAG,KAAA,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;EAEhC,MAAM,CAAC,IAAI;EAAA;;CAER,YAAY,CAAC,KAAK,CAAE,KAAK,CAAE,GAAG,CAAA;;;EAEjC,KAAA,KAAK,CAAC,MAAM,GAAG,KAAA,GAAG;EAClB,OAAA,KAAA,KAAK,CAAA,KAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;EAAA;;CAE3B,QAAQ,EAAA;;EACX,KAAA,KAAK,CAAC,MAAM,GAAG,KAAA,GAAG,CAAC,CAAC,CAAC,CAAC;EACtB,KAAA,GAAG,IAAI,CAAC;EACR,MAAM,CAAC,KAAA,KAAK,CAAC,GAAG,EAAC;EAAA;;CAEd,YAAY,EAAA;;EACf,OAAA,KAAA,KAAK,CAAA,KAAC,GAAG,CAAC;EAAA;;CAEP,KAAK,EAAA;;EACR,OAAA,EAAE;EAAA;;;AAAA,CAAA;AAAA;"},"dependencies":[],"meta":{"vite":{"lang":"js"}}}
\No newline at end of file