File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change 1
1
/*jshint node:true*/
2
- ' use strict' ;
2
+ " use strict" ;
3
3
4
- var path = require ( ' path' ) ;
4
+ var path = require ( " path" ) ;
5
5
6
6
/*
7
7
*! Miscellaneous methods
8
8
*/
9
9
10
- module . exports = function ( proto ) {
10
+ module . exports = function ( proto ) {
11
11
/**
12
12
* Use preset
13
13
*
@@ -17,22 +17,23 @@ module.exports = function(proto) {
17
17
*
18
18
* @param {String|Function } preset preset name or preset function
19
19
*/
20
- proto . usingPreset =
21
- proto . preset = function ( preset ) {
22
- if ( typeof preset === 'function' ) {
20
+ proto . usingPreset = proto . preset = function ( preset ) {
21
+ if ( typeof preset === "function" ) {
23
22
preset ( this ) ;
24
23
} else {
25
24
try {
26
25
var modulePath = path . join ( this . options . presets , preset ) ;
27
- var module = require ( modulePath ) ;
26
+ var module = require ( ` ${ modulePath } ` ) ;
28
27
29
- if ( typeof module . load === ' function' ) {
28
+ if ( typeof module . load === " function" ) {
30
29
module . load ( this ) ;
31
30
} else {
32
- throw new Error ( ' preset ' + modulePath + ' has no load() function' ) ;
31
+ throw new Error ( " preset " + modulePath + " has no load() function" ) ;
33
32
}
34
33
} catch ( err ) {
35
- throw new Error ( 'preset ' + modulePath + ' could not be loaded: ' + err . message ) ;
34
+ throw new Error (
35
+ "preset " + modulePath + " could not be loaded: " + err . message
36
+ ) ;
36
37
}
37
38
}
38
39
You can’t perform that action at this time.
0 commit comments