history-manager
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -253,3 +253,3 @@ /** | ||
function go(path_index: string | number, options: { | ||
emit: boolean; | ||
emit?: boolean; | ||
replace?: boolean; | ||
@@ -256,0 +256,0 @@ }): Promise<void>; |
@@ -253,3 +253,3 @@ /** | ||
function go(path_index: string | number, options: { | ||
emit: boolean; | ||
emit?: boolean; | ||
replace?: boolean; | ||
@@ -256,0 +256,0 @@ }): Promise<void>; |
{ | ||
"name": "history-manager", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -501,3 +501,3 @@ /** | ||
export function go(path_index: string | number, options: { | ||
emit: boolean | ||
emit?: boolean, | ||
replace?: boolean, | ||
@@ -511,3 +511,3 @@ }): Promise<void> { | ||
// let promiseResolve: () => void; | ||
options = { ...options }; | ||
const normalizedOptions = { emit: true, replace: false, ...options }; | ||
return new Promise<void>((promiseResolve: () => void, promiseReject: () => void) => { | ||
@@ -521,3 +521,3 @@ let goingEvent: CustomEvent<{ | ||
direction: path_index, | ||
...options | ||
...normalizedOptions | ||
}, | ||
@@ -535,8 +535,8 @@ cancelable: true | ||
path_index as string, | ||
(options && options.replace) || false, | ||
(options == null || options.emit == null) ? true : options.emit | ||
(normalizedOptions && normalizedOptions.replace) || false, | ||
(normalizedOptions == null || normalizedOptions.emit == null) ? true : normalizedOptions.emit | ||
).then(promiseResolve); | ||
} else { | ||
let lastEmitRoute: boolean = emitRoute; | ||
emitRoute = options.emit == null ? true : options.emit; | ||
emitRoute = normalizedOptions.emit == null ? true : normalizedOptions.emit; | ||
HistoryManager.go(path_index as number).then(promiseResolve, () => { | ||
@@ -543,0 +543,0 @@ emitRoute = lastEmitRoute; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
262009