Skip to content

Commit 01e680b

Browse files
author
blond
committed
fix(unknow preset): throw error if preset is unknown
1 parent 7273d17 commit 01e680b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,14 @@ function createNaming(options) {
249249
function init(options) {
250250
options || (options = {});
251251

252-
if (options === 'two-dashes') {
253-
return presets[options];
252+
if (typeof options === 'string') {
253+
var preset = presets[options];
254+
255+
if (!preset) {
256+
throw new Error('The `' + options + '` naming is unknown.');
257+
}
258+
259+
return preset;
254260
}
255261

256262
var defaults = presets.origin,

0 commit comments

Comments
 (0)