Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lib/core/calculateState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ export function calculateState(state: any): State;
* @param state The desired state for the given hash.
* @returns The state object that should be set, accounting for all routing universes.
*/
export function calculateState(hash: Hash, state: any): State;
export function calculateState(hash: Hash | undefined, state: any): State;
export function calculateState(hashOrState: any, state?: any): State {
let hash: Hash;
if (arguments.length === 1) {
state = hashOrState;
hash = resolveHashValue(undefined);
}
else {
hash = hashOrState;
hash = resolveHashValue(hashOrState);
}
// Get a deep clone of the complete current state using the internal symbol method
const newState = (location as LocationInternal)[getCompleteStateKey]();
Expand Down