Skip to content

Commit 5e6cc4d

Browse files
author
nhannt
committed
1 parent 68d5c94 commit 5e6cc4d

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

lib/options/misc.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*jshint node:true*/
2-
'use strict';
2+
"use strict";
33

4-
var path = require('path');
4+
var path = require("path");
55

66
/*
77
*! Miscellaneous methods
88
*/
99

10-
module.exports = function(proto) {
10+
module.exports = function (proto) {
1111
/**
1212
* Use preset
1313
*
@@ -17,22 +17,23 @@ module.exports = function(proto) {
1717
*
1818
* @param {String|Function} preset preset name or preset function
1919
*/
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") {
2322
preset(this);
2423
} else {
2524
try {
2625
var modulePath = path.join(this.options.presets, preset);
27-
var module = require(modulePath);
26+
var module = require(`${modulePath}`);
2827

29-
if (typeof module.load === 'function') {
28+
if (typeof module.load === "function") {
3029
module.load(this);
3130
} else {
32-
throw new Error('preset ' + modulePath + ' has no load() function');
31+
throw new Error("preset " + modulePath + " has no load() function");
3332
}
3433
} 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+
);
3637
}
3738
}
3839

0 commit comments

Comments
 (0)