From 1c4507c5bde74ab1a068f021326360e40364a684 Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Sat, 11 Aug 2018 15:05:40 +0200 Subject: [PATCH] :sparkles: Constant config options have no type --- src/pattern.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pattern.js b/src/pattern.js index 6a429e31786..e685dd4b5b5 100644 --- a/src/pattern.js +++ b/src/pattern.js @@ -37,8 +37,13 @@ export default function Pattern(config = false) { this.config = { ...defaults, ...config }; for (let i in config.options) { let option = config.options[i]; - if (typeof option.type === "undefined") this.options[i] = option.val / 100; - else this.options[i] = option.val; + if (typeof option === "object") { + if (typeof option.type === "undefined") + this.options[i] = option.val / 100; + else this.options[i] = option.val; + } else if (typeof option === "number") { + this.options[i] = option; + } } // Constructors