File tree 2 files changed +10
-10
lines changed
2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vuejs-logger" ,
3
3
"author" : " Justin Kames" ,
4
- "version" : " 1.3.3 " ,
4
+ "version" : " 1.3.4 " ,
5
5
"description" : " Vuejs-logger, provides customizable logging functionality for Vue.js." ,
6
6
"main" : " dist/index.js" ,
7
7
"repository" : {
11
11
"scripts" : {
12
12
"test" : " istanbul cover _mocha -- --compilers js:babel-core/register -R spec --debug" ,
13
13
"upload-coverage" : " codecov -t $CODECOV_TOKEN" ,
14
- "transpile" : " node_modules/babel-cli/bin/babel.js src --out-dir dist && node_modules/uglify-js/bin/uglifyjs dist/logger.js -c -m -o dist/logger.js" ,
15
- "prepublish" : " npm test && npm run transpile"
14
+ "build-transpile-uglify" : " node_modules/babel-cli/bin/babel.js src --out-dir dist && node_modules/uglify-js/bin/uglifyjs dist/logger.js -c -m -o dist/logger.js" ,
15
+ "build-transpile" : " node_modules/babel-cli/bin/babel.js src --out-dir dist && node_modules/uglify-js/bin/uglifyjs dist/logger.js -c -m -o dist/logger.js" ,
16
+ "prepublish" : " npm test && npm run build-transpile-uglify"
16
17
},
17
18
"license" : " MIT" ,
18
19
"babel" : {
30
31
"istanbul" : " 1.1.0-alpha.1" ,
31
32
"mocha" : " 3.4.2" ,
32
33
"uglify" : " 0.1.5" ,
33
- "vue" : " 2.4.1 "
34
+ "vue" : " 2.5.13 "
34
35
}
35
36
}
Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ export default (function () {
40
40
}
41
41
42
42
function isValidOptions ( options , logLevels ) {
43
-
44
43
if ( ! ( options . logLevel && typeof options . logLevel === 'string' && logLevels . indexOf ( options . logLevel ) > - 1 ) ) {
45
44
return false
46
45
}
@@ -60,7 +59,6 @@ export default (function () {
60
59
}
61
60
62
61
function install ( Vue , options ) {
63
- // merge provided options with the default options
64
62
options = Object . assign ( defaultOptions , options )
65
63
66
64
if ( isValidOptions ( options , logLevels ) ) {
@@ -72,11 +70,13 @@ export default (function () {
72
70
}
73
71
74
72
function getMethodName ( ) {
75
- let stackTrace = Error ( ) . stack . split ( '\n' ) [ 3 ]
73
+ let error = { }
74
+ try { throw new Error ( '' ) } catch ( e ) { error = e }
75
+ let stackTrace = error . stack . split ( '\n' ) [ 3 ]
76
76
if ( / / . test ( stackTrace ) ) {
77
77
stackTrace = stackTrace . trim ( ) . split ( ' ' ) [ 1 ]
78
78
}
79
- if ( stackTrace . includes ( '.' ) ) {
79
+ if ( stackTrace && stackTrace . includes ( '.' ) ) {
80
80
stackTrace = stackTrace . split ( '.' ) [ 1 ]
81
81
}
82
82
return stackTrace
@@ -89,5 +89,4 @@ export default (function () {
89
89
initLoggerInstance,
90
90
logLevels
91
91
}
92
- } )
93
- ( )
92
+ } ) ( )
You can’t perform that action at this time.
0 commit comments