(component: string, useLocationReplace = false)
| 73 | * Write component to URI. |
| 74 | */ |
| 75 | export function writeComponent(component: string, useLocationReplace = false) { |
| 76 | if (useHash()) { |
| 77 | if (useLocationReplace) { |
| 78 | const url = new URL(window.location.href); |
| 79 | url.hash = component; |
| 80 | window.history.replaceState(window.history.state, '', url.toString()); |
| 81 | } else { |
| 82 | window.location.hash = component; |
| 83 | } |
| 84 | } else { |
| 85 | setFakeHash(component); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Convert dictionary of strings into a URI Component. |
no test coverage detected
searching dependent graphs…