File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 1
1
import { noop } from '../../util/core' ;
2
2
import { on } from '../../util/dom' ;
3
- import { parseQuery , cleanPath , replaceSlug } from '../util' ;
3
+ import { parseQuery , cleanPath , replaceSlug , endsWith } from '../util' ;
4
4
import { History } from './base' ;
5
5
6
6
function replaceHash ( path ) {
7
7
const i = location . href . indexOf ( '#' ) ;
8
8
location . replace ( location . href . slice ( 0 , i >= 0 ? i : 0 ) + '#' + path ) ;
9
9
}
10
-
11
- function endsWith ( str , suffix ) {
12
- return str . indexOf ( suffix , str . length - suffix . length ) !== - 1 ;
13
- }
14
-
15
10
export class HashHistory extends History {
16
11
constructor ( config ) {
17
12
super ( config ) ;
Original file line number Diff line number Diff line change @@ -113,3 +113,7 @@ export function getPath(...args) {
113
113
export const replaceSlug = cached ( path => {
114
114
return path . replace ( '#' , '?id=' ) ;
115
115
} ) ;
116
+
117
+ export function endsWith ( str , suffix ) {
118
+ return str . indexOf ( suffix , str . length - suffix . length ) !== - 1 ;
119
+ }
You can’t perform that action at this time.
0 commit comments