| 22 | */ |
| 23 | class URLHashParams { |
| 24 | constructor(url) { |
| 25 | Object.defineProperty(this, "_params", { |
| 26 | enumerable: true, |
| 27 | configurable: true, |
| 28 | writable: true, |
| 29 | value: void 0 |
| 30 | }); |
| 31 | this._params = new Multimap(); |
| 32 | const hash = url.hash.slice(1); |
| 33 | const params = hash.split('&'); |
| 34 | for (const p of params) { |
| 35 | const param = p.split('='); |
| 36 | if (!param[0]) |
| 37 | continue; |
| 38 | const key = param[0]; |
| 39 | let value = null; |
| 40 | if (param.length === 2 && param[1]) { |
| 41 | value = param[1]; |
| 42 | } |
| 43 | this._params.put(key, value); |
| 44 | } |
| 45 | } |
| 46 | append(name, value = null) { |
| 47 | this._params.put(name, value); |
| 48 | } |