Skip to content

Commit d679e39

Browse files
authored
change let to var and use indexOf instead of includes (#256)
1 parent fa2f7ae commit d679e39

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

lib/hash-to-query/index.js

+9-10
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,16 @@ module.exports = {
1212
if (type === 'body') {
1313
return `
1414
<script type='text/javascript'>
15-
let hash = window.location.hash;
15+
var hash = window.location.hash;
1616
if (hash && hash.length > 1) {
17-
let pathName = window.location.pathname;
18-
console.log(pathName);
19-
if (!pathName.includes('/methods/') &&
20-
!pathName.includes('/properties/') &&
21-
!pathName.includes('/events/')) {
22-
let type = hash.slice(1, hash.indexOf('_'));
23-
let name = hash.slice(hash.indexOf('_') + 1, hash.length);
24-
let anchor = '?anchor=' + name + '&show=inherited,protected,private,deprecated';
25-
let newPath = pathName;
17+
var pathName = window.location.pathname;
18+
if (pathName.indexOf('/methods/') === -1 &&
19+
pathName.indexOf('/properties/') === -1 &&
20+
pathName.indexOf('/events/') === -1) {
21+
var type = hash.slice(1, hash.indexOf('_'));
22+
var name = hash.slice(hash.indexOf('_') + 1, hash.length);
23+
var anchor = '?anchor=' + name + '&show=inherited,protected,private,deprecated';
24+
var newPath = pathName;
2625
if (type === 'method') {
2726
newPath = pathName + '/methods/' + name;
2827
} else if (type === 'property') {

0 commit comments

Comments
 (0)