1
1
import { merge , hyphenate , isPrimitive , hasOwn } from './util/core'
2
2
3
+ const currentScript = document . currentScript
4
+
3
5
export default function ( ) {
4
6
const config = merge (
5
7
{
@@ -36,7 +38,7 @@ export default function () {
36
38
)
37
39
38
40
const script =
39
- document . currentScript ||
41
+ currentScript ||
40
42
[ ] . slice
41
43
. call ( document . getElementsByTagName ( 'script' ) )
42
44
. filter ( n => / d o c s i f y \. / . test ( n . src ) ) [ 0 ]
@@ -51,26 +53,22 @@ export default function () {
51
53
}
52
54
}
53
55
}
56
+ }
54
57
55
- if ( config . loadSidebar === true ) {
56
- config . loadSidebar = '_sidebar' + config . ext
57
- }
58
-
59
- if ( config . loadNavbar === true ) {
60
- config . loadNavbar = '_navbar' + config . ext
61
- }
62
-
63
- if ( config . coverpage === true ) {
64
- config . coverpage = '_coverpage' + config . ext
65
- }
66
-
67
- if ( config . repo === true ) {
68
- config . repo = ''
69
- }
70
-
71
- if ( config . name === true ) {
72
- config . name = ''
73
- }
58
+ if ( config . loadSidebar === true ) {
59
+ config . loadSidebar = '_sidebar' + config . ext
60
+ }
61
+ if ( config . loadNavbar === true ) {
62
+ config . loadNavbar = '_navbar' + config . ext
63
+ }
64
+ if ( config . coverpage === true ) {
65
+ config . coverpage = '_coverpage' + config . ext
66
+ }
67
+ if ( config . repo === true ) {
68
+ config . repo = ''
69
+ }
70
+ if ( config . name === true ) {
71
+ config . name = ''
74
72
}
75
73
76
74
window . $docsify = config
0 commit comments